Giter Club home page Giter Club logo

provaxmalovatko's Introduction

ProvaxMalovatko

Trieda pre JavaScript umoznujuca texturovat viacvrstvove objekty

Priklad pouzitia triedy Malovatko


var platno = document.getElementById("platno"); // vyberie DIV objekt kde sa bude kreslit
var malovatko = new Malovatko(platno, 3, 740 / 2, 591 / 2, 0.5); // vytvori nove malovatko na platne, povie rozmery DIVu, layerov (width,height) a nasledne scale, v akom zmensovat original obrazky do neho

malovatko.addBaseImg('img/produkt1/zaklad.png'); // nastavi zakladny
malovatko.addLayer(1, 'img/produkt1/santa_cast_1.png'); // prida template layeru 1
malovatko.addLayer(2, 'img/produkt1/santa_cast_2.png'); // prida template layeru 2
malovatko.addLayer(3, 'img/produkt1/santa_cast_3.png'); // prida template layeru 3

// zatial vidno len zakladny obrazok
malovatko.setLayerTexture(1, 'img/textury/textura107.png'); // pripravi texturu pre layer 1 (pouzijes v selectboxe pri zmene layeru 1 onChange)
malovatko.setLayerTexture(2, 'img/textury/textura109.png'); // pripravi texturu pre layer 2 (pouzijes v selectboxe pri zmene layeru 2 onChange)
malovatko.setLayerTexture(3, 'img/textury/textura111.png'); // pripravi texturu pre layer 3 (pouzijes v selectboxe pri zmene layeru 3 onChange)
// malovatko.render();  // prekresli cely objekt podla aktualne nastavenych textur a layerov
// malovatko.renderLayer(3);  // prekresli iba konkretny layer

Zmena textury layeru

// Zmena textury layeru
malovatko.setLayerTexture(3,'img/textury/textura110.png'); // pripravi texturu pre layer 3 (pouzijes v selectboxe pri zmene layeru 3 onChange)
// malovatko.render();  // prekresli cely objekt podla aktualne nastavenych textur a layerov
malovatko.renderLayer(3);  // prekresli iba konkretny layer

provaxmalovatko's People

Contributors

santa77 avatar intellidust avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.