04-14-2011 04:49 AM
I am new to blackberry development and i need to complete and urgent assignment, i have looked around and i dont see much material to point me in the right direction, or some just is a little confusing.
I need to split the screen into 2 the bottom half will contain a text field for input and a button, the bottom half will cover about 30% of the screen and the top half the 70% of the screen.
On the top half i want to be able to do some 2D rendering in the sence that i want to draw a square for example and move it around smoothly using a rendering loop.
What components of the api should i look into to accomplish this task ? It has to be on version 5.0
Thanks in advance.
04-14-2011 09:07 AM
Welcome to BlackBerry and the forums.
In this case, what you will need to do is put a Bitmap in the top 70% of the screen (you will need to create this dynamically to match the screen size. Then you will need to create an animation Thread that draws the moving image, image at a time.
This same sort of process is used to draw animated gifs in the following KB article:
I think this KB article will help you get what you need to do sorted out.
04-14-2011 09:29 AM
Hi, What i want to do on the top half is draw primitives like a square using the graphics library if that is the correct one to use for 2D graphics. Could you advise me a bit about this, i want to be able to draw at coordinates x,y also be able to manipulate it to rotate it and move it around smoothly using a rendering loop(like in opengl) and also change its size by defining new width and height from text boxes on the bottom 30% of the screen.
Can you tell me which library's i need to use so i can read up on them? I'm a bit lost. I've been reading about canvas and graphics but im not sure what fits my needs best.
04-14-2011 10:13 AM
Sorry I can't help with the primitive drawing. Have a look at all the Graphics methods (make sure you use the Blackberry graphics object not the Modlet one). Take the code from the KB article, and replace the graphics drawBitmap, with whatever you want to do. Start by just painting a circle and move it each time the Thread goes round the loop. Do a bit of this, and i am sure you pick up a lot of what you need to do.