Board Gradient
Although I like the wooden board textures that I use for chess and checkers, I was never quite happy with the board texture I used for Reversi for Android (some called it a dirty pool table :-). Therefore, I am trying something new in version 2.3. Instead of using a texture, I use a radial gradient on the board, which gives the impression that the board has been placed under a lamp.
This new approach also slightly reduces the size of the binary. Let me know what you think.
This new approach also slightly reduces the size of the binary. Let me know what you think.
Comments
I want to write a statergy card game and dont know which view to use.
thanks
public class MyActivity extends Activity {
@Override
public void onCreate(Bundle state) {
super.onCreate(state);
view = new MyView(...);
setContentView(view);
}
....
}
In my MyView class, I have to define how the view should draw itself. The drawing methods get a Canvas as parameter, and I am free to paint and draw whatever I like on there. So in my gaming apps, I would draw the board and pieces, and some notation text.
public class MyView extends View {
@Override
public void onDraw(Canvas canvas) {
....
}
}
If you want define more elaborate views that consist of several parts (like buttons, text windows, etc). I would also have a look at the XML approach (with Eclipse, you can simply construct the views graphically, and use the automatically generated XML).
Hope this gets you started!