Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Some sort of Layout system - Gideros Forum

Some sort of Layout system

Its not even close to a n1cke's layout :D But, this thing allow you to build something like that:


Code and a little example: https://github.com/MultiPain/Gideros_SimpleUI
It also works with my SUI lib.
Tagged:
LayoutExample.png
1065 x 664 - 30K
+1 -1 (+4 / -0 ) Share on Facebook

Comments

  • SinisterSoftSinisterSoft Maintainer
    Looking good. :)
    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
  • keszeghkeszegh Member
    thanks.
    i notice it also has this ":" thingy which was in @n1cke 's library and which seemed very alien to lua and to me. i'm not sure i even understand what happens there.
  • rrraptorrrraptor Member
    edited March 20
    keszegh said:

    i notice it also has this ":" thingy which was in @n1cke 's library and which seemed very alien to lua and to me. i'm not sure i even understand what happens there.

    local layout = Layout.new()
    	:relSize(100,100)
    	:cols()
    	:childs{...}
    Same as
    local layout = Layout.new()
    layout:relSize(100,100)
    layout:cols()
    layout:childs{...}
    The difference is that in a second variant you need to type instance name every time when you want to call its method.

    Likes: antix

    +1 -1 (+1 / -0 ) Share on Facebook
  • keszeghkeszegh Member
    thanks.
    and in the plugin code you just need to add that any function of the class returns the object (self)?
  • keszeghkeszegh Member
    thanks for the explanation, this way it makes much more sense, maybe i can even get accustomed to this, it clearly has some advantages.
  • rrraptorrrraptor Member
    edited March 26
    Small update.

    Its possible now to add SUI component using "child" (or "childs") method like this:
    sui:layout(1280,720)
    	:relSize(100,100)
    	:cols()
    	:paddingAll(4)
    	:wrap(Layout.WRAP)
    	:childs{
    			Layout.new(200):relHeight(100):cols():margin(4):paddingAll(8):setTextureBackground(tex,5):childs{
    			sui:button(Pixel.new(0,1,32,32),function() print("hello1") end, {_marginLeft = 10, _marginDown = 10, _marginRight = 10, _marginUp = 10}),
    			Layout.new(100):relHeight(50):cols():margin(4):setTextureBackground(tex,5):allowResizeAll(true),		
    			sui:button(Pixel.new(0,1,32,32),function() print("hello2") end, {_marginLeft = 10, _marginDown = 10, _marginRight = 10, _marginUp = 10}),
    			Layout.new(100):relHeight(50):cols():margin(4):setTextureBackground(tex,5):allowResizeAll(true),		
    			sui:button(Pixel.new(0,1,32,32),function() print("hello3") end, {_marginLeft = 10, _marginDown = 10, _marginRight = 10, _marginUp = 10}),
    		},
    		Layout.new():relSize(100,100):cols():margin(4):setTextureBackground(tex,5),		
    	}

    Likes: MoKaLux

    +1 -1 (+1 / -0 ) Share on Facebook
  • MoKaLuxMoKaLux Member
    @rrraptor is your code specific to resizable desktop apps or for mobile as well?
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • @MoKaLux what do you mean?) There is no platform specific code at all. The only thing is:
    Layout:allowResize
    Its for debuging :P
  • MoKaLuxMoKaLux Member
    I was talking about your layout system (cf your initial post).
    As far as I understand when you resize the window of your app all the elements adapt.
    So it's only for desktop apps?
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • rrraptorrrraptor Member
    edited March 27
    MoKaLux said:

    As far as I understand when you resize the window of your app all the elements adapt.

    Its not adapting to a screen size. You can do it by hands just in few lines.
    -- add resize listener with code:
    masterLayout:size(W,H)
    masterLayout:update()

    Likes: MoKaLux

    +1 -1 (+1 / -0 ) Share on Facebook
  • Another small update.
    • Fixed a few bugs
    • Renamed "setSolidBackgroud" to "background", "setTextureBackground" to "textureBackground"
    Now I'll try to add alignment :)
  • rrraptorrrraptor Member
    edited April 29
    I rewrote whole library :)
    It is now even more simplier, I guess.
    • Added themes support.
    • Added drop downs.
    • Added scrolling.
    • Added new auto size property (set width/height relative to parent width/height).
    • Added hover and press effects.
    • Removed relative size support due to new "dock" property.
    • Every object now have its own default graphics.
    Thats how it looks now:


    Its completely missing touch control and there is a few bugs, so Im not going to publish it yet.

    P.S. sorry for the music, I picked a random mix from my playlist xd

    Likes: keszegh, talis, MoKaLux

    +1 -1 (+3 / -0 ) Share on Facebook
  • SinisterSoftSinisterSoft Maintainer
    @rrraptor Looks AMAZING! I like the music too. :)

    It should be added in the main distro as a built-in Lua plugin when finished.
    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
Sign In or Register to comment.