Yes, use a SurfaceView!!!
At the beginning I also made the mistake using ImageViews. Use a
SurfaceView!!

Learn this:
http://www.droidnova.com/playing-with-graphics-in-android-part-i,147.html

Greetings, Martin


On 26 Feb., 00:58, Jason Arora <jaso...@gmail.com> wrote:
> I agree 100% with Robert. For a real-time video game, you want to stay
> away from High-level GUI components.
>
> Kofa, it sounds like you are making good progress. Are you using a
> SurfaceView to draw the world and cities onto yet?
>
> I recommend that you do not work on the Game Menu yet. In my opinion,
> the menu is secondary and gameplay is the most important aspect of
> developing games. Additionally, a menu can slow down the iterative
> development-testing process (unless you programmatically skip the
> menu, you will have to click through the menu EVERY time you test your
> game - which will be often).
>
> On Feb 25, 9:11 am, Robert Green <rbgrn....@gmail.com> wrote:
>
>
>
> > Vlad and Kofa,
>
> > I have to say again that all of that high level stuff (layouts and
> > imageviews) is totally inappropriate for a real-time game.  Consider
> > loading all graphics into bitmaps, running a logic thread and drawing
> > to a SurfaceView.  You will have far superior performance and can do
> > anything you want (so you won't be limited by some missing feature in
> > imageview).
>
> > On Feb 25, 5:51 am, Vladimir <vladimir.funti...@gmail.com> wrote:
>
> > > > ImageView[] var1 = new ImageView[4];
> > > > var1[0].SetId(100);
>
> > > Wouldn't work with any non-primitive type. You only get an array of
> > > handles, need to initialize each object explicitly:
> > > ...
> > > var1[0] = new ImageView(...)
> > > var1[0].setId(100);
> > > ...
>
> > > With regards to the 1st question, you can create an instance of
> > > RelativeLayout.LayoutParams and use methods such as addRule(...), then
> > > specify it when you attach a view to its parent (addView(view, params)
> > > if I remember correctly). I still recommend that you think again about
> > > using XML for most of your layouts. As the UI gets more complicated,
> > > your code will become a mess. XML layouts in Android are very
> > > flexible, it takes a while to learn the tricks, but it's worth it.
> > > You'll waste more time looking for workarounds if you choose to ignore
> > > XML.
>
> > > On Feb 24, 10:09 pm, Kofa <elk...@gmail.com> wrote:
>
> > > > First of all, sorry for the delay to reply...=P
> > > > I have just read your message... i have started already and I have
> > > > developed much I think =)
> > > > I will tell you what I have, I will focus on the "engine"(GUI):
> > > > a main menu with buttons, one with START GAME.... goes to another
> > > > activity, there another button to start the game itself, the "engine":
> > > > a new activity is called, it loads almost everything from the 2
> > > > layouts from code, not XML, i think it's more flexible.
> > > > FIRST LAYOUT: a imageview with a huge picture on it.... it has a -
> > > > onTouchEvent- that makes the scroll works...
> > > > loads too some imageviews(citys) in the same layout as the map, so
> > > > those images move with the scroll.
> > > > The other layout, the main layout, has a imageview and a
> > > > button.........and here comes the 2 problems that appeared =P:
> > > > -How can I arrange views in a RelativeLayout, but on code, not XML.
> > > > -and I can't think out how to create an array of ImageViews.
>
> > > > I tried something like this but didn't work, for example to set an ID:
>
> > > > ImageView[] var1 = new ImageView[4];
>
> > > > var1[0].SetId(100);
>
> > > > AND SORRY FOR MY ENGLISH =P

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to