bonus uk

  • Content count

  • Joined

  • Last visited

Community Reputation

126 Neutral

About bonus uk

  • Rank
  1. I know this post is over a month old but it asks a pertinent question regarding the performance of different 2D rendering methods. The best discussion of this on Android I've come across is Chris Pruett's 2010 Google IO talk. You can watch it here: [url=""][/url] It's well worth the entire hour of your time if you're new to Android game development.
  2. That's one way to do it. Don't fall into the trap of thinking that there's only one way to do something. Do whatever fits your own design and goals. It's easy when starting out to look for that silver bullet resource which tells you exactly how to do something. I'll tell you for free, it doesn't exist [img][/img]. Another way to use a Thread would be to use a SurfaceHolder inside the class which extends SurfaceView and Runnable. This now lets you entirely contain the game loop inside the RenderingView class, whilst also being a bit easier to understand than the tutorial you posted. The next step is to decide if Canvas is good enough for your needs or if you should move to OpenGL. The framework I'm current'y writing for myself is OpenGL 2.0 based and has the Android UI thread, a game logic thread and a rendering thread. Once I'm happy enough with the basics I can throw it on BitBucket and you can see how I am doing that. So, [code] public class Game extends Activity { RenderingView renderingView; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); renderingView = new RenderingView(this); setContentView(renderingView); } public void onResume() { super.onResume(); renderingView.resume(); } public void onPause() { super.onPause(); renderingView().pause(); } } public class RenderingView extends SurfaceView implements Runnable { Thread thread = null; SurfaceHolder holder; volatile boolean running = false; public RenderingView(Context context) { super(context); holder = getHolder(); } public void resume() { running = true; thread = new Thread(this); thread.start(); } public void run() { while (running) { if (!holder.getSurface().isValid()) continue; Canvas canvas = holder.lockCanvas(); // Use canvas to draw things here holder.unlockCanvasAndPost(canvas); } } public void pause() { running = false; while (true) { try { thread.join(); } catch (InterruptedException e) { // wait } } } } [/code]
  3. Google have some statistics on their developer pages which you may find useful. This page shows the breakdown of Android versions being used to access Google Play. [url=""][/url] You can see from this that versions 2.1 and below already only account for less than 7% of the devices in the wild. However, the decision on which versions the app will support will be based on whoever you're going to be working for, but for new developments it makes little sense to target versions older than 2.2 as lots of performance improvements and features (such as JIT and OpenGL ES 2.0) were added in version 2.2.
  4. I think what you're looking for is a concept in the Android SDK known as Fragments. You can find a full explanation of these here: [url=""][/url]
  5. Maya Python API

    Hi, I'm beginning to write a translator for Maya 8.5 in Python but am having an issue. I'm trying to add an enum attribute to the currently selected node and it seems to work fine until I open the attribute editor. This causes the script editor to output that it cannot create the UI element for my enum. Does anyone have any ideas what causes this? Thanks.