Hello,

Been learning Android over the last 2 months. I am currently working
on an game that is a turn based board game. It currently has a main
layout that uses a spinner and an adapter to pull a list of saved
games out of a sqlite db. It also has a new game function that stores
initial game settings in the db. I have now moved on to getting the
initial board and player controls drawn when a new game is started or
when a saved game is selected.

I first learned to create the board with standard drawLine & drawRect
commands. I used the width and height in onSizeChanged to calculate
how and where to place each part of the board. This method works great
for all screen sizes. I can calculate exactly what controls a player
touches or what squares a player touches.

But I am no artist, so if figure if I want better graphics I will need
to hire someone to create bitmaps for me, instead of just drawing the
board.

My question about doing this with bitmaps is that since I need to
calculate exactly what area of the board has been touched - both for
specific player commands and to know what square to put the piece in,
how do I calculate that with using bitmaps when there are so many
screensizes that the bitmaps will be scaled to. For example, I watched
a Google I/O 2010 video where it showed an example of how a bitmap
would be scaled and although you can prescale the width and height to
whatever you want, the actual pixels for say a "boarder" may end up
being 2 pixels wide or 4 pixels wide or 1 - depending on the image and
how the system scales it. But for my game, I would need to know
exactly how wide the boarders are, their location and exactly where
each square block is on every screen resolution in order to know what
area has been touched.

So, far everything I have found just shows how to scale bitmaps and
used the three standard densities in the drawable directories. What I
wonder about the drawable directories is if I created three sizes for
different densities wouldn't the system just scale it to a different
size anyway sometimes, because there are more than 3 screen sizes out
there. From what I read there used to be 5 and now there are even more
with the tablets.

I would appreciate it, if someone could point me in the right
direction to learn how to calculate specific locations on a background
bitmap (in this case a background board game) no matter what
dimensions the bitmap is resized to.

Thank you,

--Mike

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

Reply via email to