Skip to content

Commit

Permalink
render; luxe; give everything names
Browse files Browse the repository at this point in the history
  • Loading branch information
ruby0x1 committed Aug 12, 2015
1 parent 60c2ca9 commit db309e1
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 4 deletions.
1 change: 1 addition & 0 deletions mint/render/luxe/Button.hx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Button extends mint.render.Render {
color_down = def(_opt.color_down, new Color().rgb(0x444444));

visual = new luxe.Sprite({
name: control.name+'.visual',
batcher: render.options.batcher,
centered: false,
pos: new Vector(control.x, control.y),
Expand Down
1 change: 1 addition & 0 deletions mint/render/luxe/Canvas.hx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Canvas extends mint.render.Render {
color = def(_opt.color, new Color(0,0,0,0).rgb(0x0c0c0c));

visual = Luxe.draw.box({
id: control.name+'.visual',
batcher: render.options.batcher,
x:control.x,
y:control.y,
Expand Down
3 changes: 3 additions & 0 deletions mint/render/luxe/Checkbox.hx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class Checkbox extends mint.render.Render {
color_node_hover = def(_opt.color_node_hover, new Color().rgb(0xadca63));

visual = new luxe.Sprite({
name: control.name+'.visual',
batcher: render.options.batcher,
centered: false,
pos: new Vector(control.x, control.y),
Expand All @@ -58,6 +59,7 @@ class Checkbox extends mint.render.Render {
});

node_off = new luxe.Sprite({
name: control.name+'.node_off',
batcher: render.options.batcher,
centered: false,
pos: new Vector(control.x+4, control.y+4),
Expand All @@ -69,6 +71,7 @@ class Checkbox extends mint.render.Render {
});

node = new luxe.Sprite({
name: control.name+'.node_on',
batcher: render.options.batcher,
centered: false,
pos: new Vector(control.x+4, control.y+4),
Expand Down
2 changes: 2 additions & 0 deletions mint/render/luxe/Dropdown.hx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Dropdown extends mint.render.Render {
color_border = def(_opt.color_border, new Color().rgb(0x121212));

visual = Luxe.draw.box({
id: control.name+'.visual',
batcher: render.options.batcher,
x:control.x,
y:control.y,
Expand All @@ -54,6 +55,7 @@ class Dropdown extends mint.render.Render {
});

border = Luxe.draw.rectangle({
id: control.name+'.border',
batcher: render.options.batcher,
x: control.x,
y: control.y,
Expand Down
1 change: 1 addition & 0 deletions mint/render/luxe/Image.hx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class Image extends mint.render.Render {
}

visual = new luxe.Sprite({
name: control.name+'.visual',
batcher: render.options.batcher,
centered: false,
texture: texture,
Expand Down
1 change: 1 addition & 0 deletions mint/render/luxe/Label.hx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Label extends mint.render.Render {
color_hover = def(_opt.color_hover, new Color().rgb(0x9dca63));

text = new luxe.Text({
name: control.name+'.text',
batcher: render.options.batcher,
bounds: new luxe.Rectangle(control.x, control.y, control.w, control.h),
color: color,
Expand Down
1 change: 1 addition & 0 deletions mint/render/luxe/Panel.hx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Panel extends mint.render.Render {
color = def(_opt.color, new Color().rgb(0x242424));

visual = Luxe.draw.box({
id: control.name+'.visual',
batcher: render.options.batcher,
x:control.x,
y:control.y,
Expand Down
2 changes: 2 additions & 0 deletions mint/render/luxe/Progress.hx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Progress extends mint.render.Render {
color_bar = def(_opt.color_bar, new Color().rgb(0x9dca63));

visual = Luxe.draw.box({
id: control.name+'.visual',
batcher: render.options.batcher,
x:control.x,
y:control.y,
Expand All @@ -54,6 +55,7 @@ class Progress extends mint.render.Render {
});

bar = Luxe.draw.box({
id: control.name+'.bar',
batcher: render.options.batcher,
x:control.x+margin,
y:control.y+margin,
Expand Down
3 changes: 3 additions & 0 deletions mint/render/luxe/Scroll.hx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Scroll extends mint.render.Render {
color_handles = def(_opt.color_handles, new Color().rgb(0x9dca63));

visual = new luxe.Sprite({
name: control.name+'.visual',
batcher: render.options.batcher,
centered: false,
pos: new Vector(control.x, control.y),
Expand All @@ -53,6 +54,7 @@ class Scroll extends mint.render.Render {
});

scrollh = new luxe.Sprite({
name: control.name+'.scrollh',
batcher: render.options.batcher,
centered: false,
pos: new Vector(scroll.scrollh.x, scroll.scrollh.y),
Expand All @@ -64,6 +66,7 @@ class Scroll extends mint.render.Render {
});

scrollv = new luxe.Sprite({
name: control.name+'.scrollv',
batcher: render.options.batcher,
centered: false,
pos: new Vector(scroll.scrollv.x, scroll.scrollv.y),
Expand Down
2 changes: 2 additions & 0 deletions mint/render/luxe/Slider.hx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Slider extends mint.render.Render {
color_bar = def(_opt.color_bar, new Color().rgb(0x9dca63));

visual = Luxe.draw.box({
id: control.name+'.visual',
batcher: render.options.batcher,
x:control.x,
y:control.y,
Expand All @@ -54,6 +55,7 @@ class Slider extends mint.render.Render {
});

bar = Luxe.draw.box({
id: control.name+'.bar',
batcher: render.options.batcher,
x:control.x + slider.bar_x,
y:control.y + slider.bar_y,
Expand Down
3 changes: 3 additions & 0 deletions mint/render/luxe/TextEdit.hx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class TextEdit extends mint.render.Render {
color_cursor = def(_opt.color_cursor, new Color().rgb(0x9dca63));

visual = Luxe.draw.box({
id: control.name+'.visual',
batcher: render.options.batcher,
x:control.x,
y:control.y,
Expand All @@ -57,6 +58,7 @@ class TextEdit extends mint.render.Render {
});

cursor = Luxe.draw.line({
id: control.name+'.cursor',
batcher: render.options.batcher,
p0: new Vector(0,0),
p1: new Vector(0,0),
Expand Down Expand Up @@ -85,6 +87,7 @@ class TextEdit extends mint.render.Render {

if(textedit.isfocused) {
Luxe.draw.rectangle({
id: control.name+'.border',
batcher: render.options.batcher,
x:textedit.x,
y:textedit.y,
Expand Down
3 changes: 3 additions & 0 deletions mint/render/luxe/Window.hx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Window extends mint.render.Render {
color_titlebar = def(_opt.color_titlebar, new Color().rgb(0x373737));

visual = Luxe.draw.box({
id: control.name+'.visual',
batcher: render.options.batcher,
x:window.x,
y:window.y,
Expand All @@ -58,6 +59,7 @@ class Window extends mint.render.Render {
});

top = Luxe.draw.box({
id: control.name+'.top',
batcher: render.options.batcher,
x: window.title.x,
y:window.title.y,
Expand All @@ -71,6 +73,7 @@ class Window extends mint.render.Render {
});

border = Luxe.draw.rectangle({
id: control.name+'.border',
batcher: render.options.batcher,
x: window.x,
y: window.y,
Expand Down
6 changes: 5 additions & 1 deletion tests/test_luxe/src/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ class Main extends luxe.Game {
layout = new Margins();

canvas = new mint.Canvas({
name:'canvas',
rendering: rendering,
options: { color:new Color(1,1,1,0.0) },
x: 0, y:0, w: 960, h: 640
});

disp = new Text({
name:'display.text',
pos: new Vector(Luxe.screen.w-10, Luxe.screen.h-10),
align: luxe.TextAlign.right,
align_vertical: luxe.TextAlign.bottom,
Expand All @@ -46,6 +48,7 @@ class Main extends luxe.Game {
});

canvas_debug = new Text({
name:'debug.text',
text: 'debug: (${Luxe.snow.os} / ${Luxe.snow.platform})',
point_size: 14,
pos: new Vector(950, 10),
Expand Down Expand Up @@ -82,7 +85,8 @@ class Main extends luxe.Game {
config.preload.textures.push({ id:'assets/mint.box.png' });

return config;
}

} //config

override function onrender() {

Expand Down
8 changes: 5 additions & 3 deletions tests/test_luxe/src/tests/KitchenSink.hx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class KitchenSink extends State {

// Luxe.snow.windowing.enable_vsync(false);

bg = new luxe.Sprite({ texture:Luxe.resources.texture('assets/960.png'), centered:false, depth:-1 });
bg = new luxe.Sprite({ name:'bg',texture:Luxe.resources.texture('assets/960.png'), centered:false, depth:-1 });

create_basics();
create_window1();
Expand Down Expand Up @@ -253,9 +253,10 @@ class KitchenSink extends State {

new mint.Label({
parent: canvas,
name: 'label1',
name: 'labelmain',
x:10, y:10, w:100, h:32,
text: 'hello mint',
align:left,
text_size: 14,
onclick: function(e,c) {trace('hello mint! ${Luxe.time}' );}
});
Expand Down Expand Up @@ -356,7 +357,7 @@ class KitchenSink extends State {

new mint.Image({
parent: _scroll,
name: 'image2',
name: 'image_other',
x:0, y:100, w:512, h: 512,
path: 'assets/image.png'
});
Expand Down Expand Up @@ -398,6 +399,7 @@ class CustomWindowRenderer extends mint.render.Render {
window = _control;

visual = new luxe.NineSlice({
name: _control.name + '.visual',
texture : Luxe.resources.texture('assets/mint.box.png'),
top : 32, left : 32, right : 32, bottom : 32,
});
Expand Down

0 comments on commit db309e1

Please sign in to comment.