Skip to content

Instantly share code, notes, and snippets.

@AppWerft
Created August 30, 2018 13:40
Show Gist options
  • Save AppWerft/ef3aeb4dba1be16e31e848387cab6398 to your computer and use it in GitHub Desktop.
Save AppWerft/ef3aeb4dba1be16e31e848387cab6398 to your computer and use it in GitHub Desktop.
module.exports = function() {
const $ = Ti.UI.createView({});
$.add(Ti.UI.createImageView({
image : '/assets/images/left.png',
height : '60%',
width : '80%',
opacity : 0.36,
top : 10
}));
$.add(Ti.UI.createLabel({
text : '',
font : {
fontSize : 32
},
top : 50,
textAlign : 'center',
color : GOLD
}));
$.add(Ti.UI.createLabel({
text : '',
left : 10,
right : 10,
font : {
fontSize : 40
},
top : 120,
height : 100,
textAlign : 'center',
color : 'white'
}));
$.setAngle = function(a) {
const steps = Math.round(a / 36);
var text = '';
for (var i = 0; i < Math.abs(steps); i++) {
text += (a < 0) ? '▶︎︎' : '◀︎︎';
}
const image = '/assets/images/' + ((a > 0) ? 'left.png' : 'right.png');
a$.children[2].setText(text);
$.children[1].setText((a > 0) ? L('PLEASE_ROTATE_LEFT') : L('PLEASE_ROTATE_RIGHT'));
$.children[0].setImage(image);
//$.children[1].textAlign=a>0?'left':'right';
};
return $;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment