[android-developers] Can't get SurfaceView working, trying to make a simple 2D-shooter!

2009-11-01 Thread klirr
It is way to slow and in the first example it doesnt even move. How do I make a game? With SurfaceView or OpenGL? And should I draw in a separate thread? package com.android.WWS; import android.app.Activity; import android.content.Context; import android.graphics.*; import

[android-developers] Trouble redrawing a View, using OnKeyListener, onDraw and invalidate.

2009-05-16 Thread klirr
The green plane is shown on the golden-brown surface but when I press a key nothing happens. I want eventually be able to move the plane pressing 4 different keys + another one for shooting but that's easy if I can just get the thing moving in the first place. When I press a key in the emulator,

[android-developers] trouble with using keyboard-input to move things on screen, using requestFocus, OnKeyListener etc unsuccessfully.

2009-05-17 Thread klirr
package com.android.shmup; import android.app.Activity; import android.content.Context; import android.graphics.*; import android.os.Bundle; import android.view.View; import android.view.KeyEvent; import android.view.View.OnKeyListener; public class Shmup extends Activity { //GraphicsActivity {

[android-developers] Re: trouble with using keyboard-input to move things on screen, using requestFocus, OnKeyListener etc unsuccessfully.

2009-05-17 Thread klirr
added setFocusable(true); but still doesn't work. package com.android.shmup; import android.app.Activity; import android.content.Context; import android.graphics.*; import android.os.Bundle; import android.view.View; import android.view.KeyEvent; import android.view.View.OnKeyListener; public

[android-developers] How to make games faster? Using view and redraw is way to slow it seems.

2009-05-17 Thread klirr
I have done a simple game where I draw on a View and use invalidate() to force onDraw to be called. This however doesn't seem to scale at all since even for this little game it is quite slow. So what is the solution, to use openGL? that is what all games should? and then I should use frames

[android-developers] Can't figure out how to use SurfaceView properly, nothing is drawn

2009-05-31 Thread klirr
I had it working with a normal View but that is to slow. I was told to use SurfaceView but can't figure out how to use OnKey with it and if I should use onDraw or draw? And how do I pass stuff to draw? does it happen automatically? package com.android.WWS; import android.app.Activity; import

[android-developers] Don't understand how to use SurfaceView for my game, have it working with nomrla View.

2009-06-02 Thread klirr
Problems with using SurfaceView, I don't understand how to draw to it. It has to be done manually? How? package com.android.WWS; import android.app.Activity; import android.content.Context; import android.graphics.*; import android.os.Bundle; import android.view.SurfaceView; import

[android-developers] Problems drawing a SurfaceView

2009-07-20 Thread klirr
This just makes the screen black, why? I don't understand how to force the draw of the SurfaceView. package com.android.WWS; import android.app.Activity; import android.content.Context; import android.graphics.*; import android.os.Bundle; import android.view.SurfaceView; import

[android-developers] Re: Problems drawing a SurfaceView

2009-07-21 Thread klirr
Thanks, that works. However it doesn't redraw when I press the keypad. Why not? This is what I have now: package com.android.WWS; import android.app.Activity; import android.content.Context; import android.graphics.*; import android.os.Bundle; import android.view.SurfaceView; import

[android-developers] Re: Problems drawing a SurfaceView

2009-07-21 Thread klirr
Thanks now it works. however the reason I use SurfaceView was because I tried with View first but it is way to slow. Problem is, it still is. The redrawing just isn't anywhere fast enough for a game. So unless it is a lot faster on the real phone this won't cut it at all. Is it necessary to use

[android-developers] SurfaceView to slow for games? OpenGL necessary to do games?

2009-07-21 Thread klirr
I use SurfaceView for my game, tried normal View first but that was to slow. Problem is, it still is. The redrawing just isn't anywhere fast enough for a game. So unless it is a lot faster on the real phone this won't cut it at all. Is it necessary to use OpenGL for games? package

[android-developers] Re: SurfaceView to slow for games? OpenGL necessary to do games?

2009-07-21 Thread klirr
no, thanks for the tip. should I have one main thread and then have one drawing-thread running the whole time then? and GameView should implement Runnable? what should be in run()? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[android-developers] How to use Thread with SurfaceView, ie draw in a separate thread?

2009-07-22 Thread klirr
I want to do the drawing in another thread to speed up the game(it is way to slow right now). I was told to do this but don't quite understand why that would speed things up. Is it GameView that should implement Runnable? Should I make the thread sleep when not drawing? where should I start the