Positioning question

20 views
Skip to first unread message

he...@tailon.za.net

unread,
May 7, 2014, 10:50:50 AM5/7/14
to codenameone...@googlegroups.com
Hi all

New to CN1 have a question regarding dynamically placing objects such as buttons and labels, or how do i specify in a gridlayout what cell the object is placed in  , or how do i specify what x , y coords to place the object , how do i go about doing that ?

Thanks in advance

Tails

iola...@gmail.com

unread,
May 7, 2014, 11:40:35 AM5/7/14
to codenameone...@googlegroups.com
When specifying a form or container, you can also specify the layout. There are several layout managers. You can find more information about the use of them in the Developer guide: http://www.codenameone.com/developer-guide.html from page 21.

X and Y coords are usually not used.

In a grid layout components are placed in the next 'free' row/column. Where it is placed depends on the order of components you place in the Grid Layout.

Shai Almog

unread,
May 8, 2014, 1:45:49 AM5/8/14
to codenameone...@googlegroups.com, iola...@gmail.com

he...@tailon.za.net

unread,
May 8, 2014, 1:49:46 AM5/8/14
to codenameone...@googlegroups.com
Thanks Guys , let me explain what i am trying to-do , i am writing a tetris like game , with square tiles falling from the top of the screen that can be moved while they are falling . is this possible at all , and if so how would i go about doing that .

Thanks

Shai Almog

unread,
May 8, 2014, 2:12:38 AM5/8/14
to codenameone...@googlegroups.com
For something like that you will need to build your own layout manager or use graphics to draw your elements by overriding paint() in a component.
Reply all
Reply to author
Forward
0 new messages