So, again, I need help with a design issue. ;-)))

I am trying to translate and rotate,  following user input, a couple
of triangles for a game.

Sure enough, to get the user input, I have:
public class TangroidView extends SurfaceView implements
SurfaceHolder.Callback

Only, what class should I use/extend for the triangles? Or should I go
from scratch?

I could extend View because it get user input but View is rectangular
which is not OK
for clicking on the triangle. By the way, may View be other than
rectangular?

Should I extend ShapeDrawable which takes a Path but, as it, does not
take user input?

Create a png file of the triangle but... the ImageView will be
rectangular again?

Or yet, go with OpenGL 3D but use only the 2D? They seem to have some
nice methods
to move and rotate shapes...

Or go totally from scratch calculating if the user clicks inside of
the triangle (a closed Path)
and the coordinates to move the triangle subsequently? By the way,
none of existing graphic
objects (Path, for instance) keeps track and return the coordinates of
the points that have
been used to create them. And... it doesn't look like there is a
Coordinates class.

So, I feel like there is no suitable class to extend for them, so
should I go from scratch?
Meaning… getting the coordinates of the user clicks, then calculating,
using determinants,
to see if it falls on the triangle and which one, then move or rotate
this particular triangle
by calculating its new coordinates… which is quite. Will the phone be
able to handle all
those calculations? That’s why I was first trying to see if there is a
class with a suitable
behavior for me to extend.

In the spirit of Android,

M ;-)))


On Dec 1, 12:40 pm, M <mila.crid...@yahoo.com> wrote:
> Hi!
>
> I am trying to move a triangle for a graphic application
> following user input.
>
> May a View be other than rectangular? Should I extend
> ShapeDrawable which, as it, does not take user input?
> Create a png file of the triangle but the ImageView will
> be rectangular again? Or go totally from scratch calculating
> if the user clicks inside of the triangle (which would be
> a closed Path) and then the coordinates of the triangle
> to move it subsequently?
>
> Thanks to ya'!
>
> M ;-)))

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

Reply via email to