Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Posts: 49
Registered: ‎03-27-2013
My Device: z10
My Carrier: Banglalink

gameplay user interface

In Sample06 of gameplay I found that a menu is shown. I am invesdicating on that and found a .form file containg a .theme file and .theme file containing .png (texture). And also I saw in .form file there are lots of label & button specifying there fixed position.


Now my question is can I draw label/button dynamically in any position from my C++ code and also is it necessary to use .form, .there and .png file ??


Thanks for your co-operation.

Posts: 74
Registered: ‎07-22-2008
My Device: BlackBerry Z10
My Carrier: N/A

Re: gameplay user interface

You can create UI forms programmatically without the use of a .form file.  You do however need a .theme file and a theme image.  The following method creates a form from C++ code:
static Form* create(const char* id, Theme:Smiley Frustratedtyle* style, Layout::Type layoutType = Layout::LAYOUT_ABSOLUTE);

Pratik Sapra
Gaming & Apps Consultant
Developer Relations