@authur: Qingdujun April 15, 2015 21:00:03
Mainactivity.java Set Full screen, note: its settings must be before Setcontentview;
PackageCom.qdj.gameone;ImportCom.qdj.ui.ViewOne;Importandroid.support.v7.app.ActionBarActivity;ImportAndroid.os.Bundle;ImportAndroid.view.Window;ImportAndroid.view.WindowManager; Public classMainactivityextendsactionbaractivity {@Overrideprotected voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); /*Note that some flags must was set before the window decoration is created.*/GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLA G_fullscreen); /*Flag for the ' No title ' feature, turning off the title at the top of the screen.*/requestwindowfeature (Window.feature_no_title); Setcontentview (NewViewone ( This)); }}/*** Chinese (Chinese): * GetWindow (). SetFlags ()--Used to remove the top battery display portion of the interface; * Requestwindowfeature ()--is used to remove the title bar (not the top part of the battery); */
Custom View
PackageCom.qdj.ui;ImportAndroid.content.Context;ImportAndroid.graphics.Canvas;ImportAndroid.graphics.Color;ImportAndroid.graphics.Paint;ImportAndroid.view.View; Public classViewoneextendsView {PrivatePaint paint =NULL; PublicViewone (Context context) {Super(context); Paint=NewPaint (); /*setting or clearing the anti_alias_flag bit * antialiasing smooths out the edges of what is being DRAWN.*/Paint.setantialias (true); /*Controls Whether the screen should remain on.*/Setkeepscreenon (true); Paint.setcolor (color.red); } @Override Public voidOnDraw (canvas canvas) {/*set background color.*/Canvas.drawcolor (Color.Black); Canvas.drawtext ("Android Game Develop", 30, 30, paint); }}
Android game Development (i): screen and use of brushes