Skip to content

logicallabs/ti.glpaint

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ti.GLPaint

This module is still work in progress. The opacity currently cannot be changed and the image needs to be placed inside the module directly.

Usage

var module = require("ti.glpaint");
var win = Ti.UI.createWindow({
    backgroundColor: "#fff"
});
var paintView = module.createPaintView({
    brush: {
        opacity: 10,
        tintColor: "red",
        image: "brush.png"
    },
    top: 100
});

var btn1 = Ti.UI.createButton({
    title: "Change to green color",
    top: 30
});

var btn2 = Ti.UI.createButton({
    title: "Erase",
    top: 50
});

btn1.addEventListener("click", function() {
    paintView.setBrush({
    opacity: 5,
        tintColor: "green",
        image: "brush2.png"
    });
});

btn2.addEventListener("click", function() {
    paintView.erase();
});

win.add(paintView);
win.add(btn1);
win.add(btn2);
win.open();

Copyright

© 2016 by Hans Knoechel

About

Support for OpenGL drawing with Titanium Mobile

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 79.5%
  • C 11.1%
  • Python 8.7%
  • JavaScript 0.7%