@MoKaLux yes, but its simple I guess ))) As an example:
local slider = gui.Slider.new{
w =200, -- width of slider
h =4, -- height of the slider line (used by shape)min=0, -- minimum slider value (can be negative or floating point value)max=100, -- maximum slider value
value =50, -- initial value
shape ={-- line shape parameters -- there only 2 types availeble for now --(Image and Shape) Shape is a builtin graphics (Path2D)-- for image you can also set ninePatch flag type= gui.TShape,
name ="rect", -- shape form
style ="slider", -- color style},
knob ={-- knob paramstype= gui.TImage,
image = Texture.new("libs/GUI/gfx/PNG/blue_sliderDown.png", true),
imageArgs ={scale = .3}, -- standart keys for "set" function
ax = .5, -- x anchor
ay =0.8, -- y anchor},
label ={-- text parameters
style ="label", -- color style
display ="Right: ", -- text to display
decimals =0, -- how many decimals numbers
pad =4, -- how many leading zeroes you want to use
offsetY =4, -- offset text position
flags = FontBase.TLF_RIGHT
},
onDrop =function(slider)print("Drop:",slider.value)end, -- callbacks
onDrag =function(knob)print("Drag:", knob.value)end,
}
slider:setPosition(10, 280)
stage:addChild(slider)
Buttons even more simplier:
btn = gui.Button.new{
w =100, h =100,
shadow =true,
shadowOX =4,
shadowOY =4,
shape ={type= gui.TShape,
r =50,
name ="circle",
style ="button",
},
label ={
style ="label",
text ="This is a text button!",
},
callback =function()print("Hello, world")end}
btn:setPosition(50, 50)
stage:addChild(btn)
Hm, I have a qestion before Ill put myself in a situation where I need to refactor everything Is it better to implement callbacks as gideros events OR as function parameter like I have right now (see code above)? In other words: Which one is better?
local btn = gui.Button.new{
w =100, h =50,
shape ={type= gui.TShape, style ="button", r =10},
label ={style ="label", text ="Click me"},
callback =function(button, event)print(event.x, event.y)end}-- SLIDER:local slider = gui.Slider.new{
w =200, h =10, min=0, max=255,
shape ={type= gui.TShape, style ="slider", name ="rect"},
knob ={type= gui.TShape, style ="knob", name ="circle", r =20},
onDrop =function(slider)print("Drop:",slider.value)end,
onDrag =function(knob)print("Drag:", knob.value)end,
}
VS
local btn = gui.Button.new{
w =100, h =50,
shape ={style ="button", r =10},
label ={style ="label", text ="Click me"},
}
btn:addEventListener("onTap", function buttonClick(event)print(event.x, event.y)end)-- SLIDER:local slider = gui.Slider.new{
w =200, h =10, min=0, max=255,
shape ={type= gui.TShape, style ="slider", name ="rect"},
knob ={type= gui.TShape, style ="knob", name ="circle", r =20},
}
slider:addEventListener("onDrop", function(value)print("Drop", value)end)
slider:addEventListener("onDragStart", function(value)print("DragStart", value)end)
slider:addEventListener("onDrag", function(value)print("Drag", value)end)
I'd also be keen to learn what kinds of display everyone uses. I've been trying to keep my GUI editor window kind of small but am fast running out of screen real-estate. I'm thinking to make the application work with 1920x1080 but could compromise if others have inferior resolutions
I'd also be keen to learn what kinds of display everyone uses. I've been trying to keep my GUI editor window kind of small but am fast running out of screen real-estate. I'm thinking to make the application work with 1920x1080 but could compromise if others have inferior resolutions
It seems that phone resolutions are pretty high nowadays
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
I'd also be keen to learn what kinds of display everyone uses. I've been trying to keep my GUI editor window kind of small but am fast running out of screen real-estate. I'm thinking to make the application work with 1920x1080 but could compromise if others have inferior resolutions
It seems that phone resolutions are pretty high nowadays
Ahh sorry guys.. I meant to say "What resolutions do your development machines use"?
Personally I use FullHD@1920x1080, but I guess it's sort of antique nowadays.
I guess it's hard to tell what do developers use (they're different from general public)
Some developers use 2k/4k monitors, it's convenient, sometimes ultra-wide 2560x1080. Sometimes smaller (1600x900 or even 1366x768 on an old laptop). And of course there're crApple Macbooks&Monitors with their own standarts.
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Honestly, my lib does not support mouse yet Since it is based on Soda Gesture class. But Im using only 2 gestures for now (tap and drag), so I'll adapt class for mouse soon or later
@MoKaLux mouse scrolling is supported in 'Layout' class
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
@rrraptor looking very cool man! I've just got my editor to a stage where it is actually able to be used to edit interfaces. I'll try to make a wee youtube video soon.
What application do you use to create your GIF animations?
I'm still trying to make this thing alive Fixed a few bugs; a bit of refactoring (and a lot more incoming ) Added dropdown and grid components.
And I have a question about gc.
I tried to create a simple animation like this:
function animTest()local win = GUI.Window.new(...)-- create local instance of window
Timer.delayedCall(2000, function()-- run 2 seconds timer
win:setInactive(true)-- disable window local mc = MovieClip.new{-- run animation{1, 60, win, {alpha ={1, 0, "linear"}}}}
mc:addEventListener(Event.COMPLETE, function()-- when animation is finished
win:dispose()-- destroy windowend)end)end
BUT! I have a debug window that outputs the lua memory usage:
function GameScene:update(e)local dt = e.deltaTime
counter += dt
if(counter >1)then-- once per secondlocal fps =(((1/dt)*100)//1)/100
gui.params:setText("FPS", fps, true)collectgarbage()-- "win" instance gets collected here and animation stops
gui.params:setText("Memory", collectgarbage("count"), true)
counter =0end
gui.params:setText("Update", #gui.updateArr)end
The question is: is it correct behaviour? In theory, it is not correct, because this instace is used by MovieClip. Its not realy a problem, because I'll implement stack system, so it wont be collected. Just wondering
What happens is that your MovieClip instance is collected because you don’t keep a reference to it, and thus the animation is stopped, listeners are discarded and win is also released. There is an optional and undocumented second parameter to MovieClip.new that can be used to tell MovieClip to keep a reference to itself while it is playing. Set it to true and see if that fixes your issue.
What happens is that your MovieClip instance is collected because you don’t keep a reference to it, and thus the animation is stopped, listeners are discarded and win is also released.
There is an optional and undocumented second parameter to MovieClip.new that can be used to tell MovieClip to keep a reference to itself while it is playing. Set it to true and see if that fixes your issue.
Comments
I've just added fonts to my editor and am about to get text working on widgets.
Likes: keszegh
Likes: Apollo14, antix
Also, shadows now works with images, but I need to modify shader to make it look better
P.S. Actualy it looks ok, if the image is not scaled.No, its not
As an example:
Buttons even more simplier:
Is it too complicated?
Likes: MoKaLux, plicatibu
Is it better to implement callbacks as gideros events OR as function parameter like I have right now (see code above)? In other words:
Which one is better?
VS
Likes: SinisterSoft
Plain functions are probably better in the end (as @hgy29 said) but EventListeners really only become a problem when you use too many.
https://deviceatlas.com/blog/most-used-smartphone-screen-resolutions
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
I don't think anyone would EVER want to use a touch interface to edit user interfaces
I guess it's hard to tell what do developers use (they're different from general public)
Some developers use 2k/4k monitors, it's convenient, sometimes ultra-wide 2560x1080.
Sometimes smaller (1600x900 or even 1366x768 on an old laptop).
And of course there're
crApple Macbooks&Monitors with their own standarts.Likes: antix
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
laptop can't remember, but around 3600x1400 or something (retina type screen)
Likes: antix
https://deluxepixel.com
Works a little bit buggy, but I'll fix it later
Also, added vertical sliders and checkboxes
Likes: MoKaLux, antix, plicatibu
https://wiki.giderosmobile.com/index.php/UI_Scrollable_List
The only thing missing is to scroll with the mouse wheel!
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
@Apollo14 can I have your opinion on the "new" navigation please? Example:
https://wiki.giderosmobile.com/index.php/Application:canOpenUrl
I need some more feedback
Likes: MoKaLux
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
What application do you use to create your GIF animations?
I've made a video of my interface editor...
Sorry for the crap quality, I'll do better next time. I really need to learn how to make nicer videos
Its created using electron and NodeJS. Everything you see is pure JavaScript... no JQuery and no Bootstrap, just my own junk
Likes: oleg, SinisterSoft, MoKaLux, rrraptor
Fixed a few bugs; a bit of refactoring (and a lot more incoming )
Added dropdown and grid components.
And I have a question about gc.
I tried to create a simple animation like this:
Its not realy a problem, because I'll implement stack system, so it wont be collected. Just wondering
There is an optional and undocumented second parameter to MovieClip.new that can be used to tell MovieClip to keep a reference to itself while it is playing. Set it to true and see if that fixes your issue.
@hgy29 is there a way to make them smooth?)
Test code: