Revision 5af2b7a9
Added by Leszek Koltunski almost 4 years ago
| src/main/java/org/distorted/config/ConfigRenderer.java | ||
|---|---|---|
| 31 | 31 |
import javax.microedition.khronos.egl.EGLConfig; |
| 32 | 32 |
import javax.microedition.khronos.opengles.GL10; |
| 33 | 33 |
|
| 34 |
import static org.distorted.config.ConfigScreenPane.PADDING_RATIO; |
|
| 35 |
|
|
| 34 | 36 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 35 | 37 |
|
| 36 | 38 |
public class ConfigRenderer implements GLSurfaceView.Renderer, DistortedLibrary.ExceptionListener |
| ... | ... | |
| 66 | 68 |
{
|
| 67 | 69 |
mScreen.resize(width,height); |
| 68 | 70 |
mView.setScreenSize(width,height); |
| 71 |
|
|
| 72 |
int debugWidth = (int)(0.2f*width); |
|
| 73 |
int debugHeight= (int)(0.5*debugWidth); |
|
| 74 |
int gap = (int)(width*PADDING_RATIO); |
|
| 75 |
int textColor = 0xffffffff; |
|
| 76 |
int backColor = 0xff333333; |
|
| 77 |
|
|
| 78 |
mScreen.showFPS(debugWidth,debugHeight,gap,textColor,backColor); |
|
| 69 | 79 |
} |
| 70 | 80 |
|
| 71 | 81 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/java/org/distorted/config/ConfigScreenPane.java | ||
|---|---|---|
| 51 | 51 |
}; |
| 52 | 52 |
|
| 53 | 53 |
private static final int NUM_IMAGES = IMAGES.length; |
| 54 |
private static final float PADDING_RATIO = 0.015f;
|
|
| 55 |
private static final float TEXT_RATIO = 0.025f;
|
|
| 54 |
public static final float PADDING_RATIO = 0.025f;
|
|
| 55 |
private static final float TEXT_RATIO = 0.040f;
|
|
| 56 | 56 |
private static final float RADIO_RATIO = 0.900f; |
| 57 | 57 |
|
| 58 | 58 |
private JsonReader mReader; |
| ... | ... | |
| 116 | 116 |
|
| 117 | 117 |
ConfigScreenPane(final ConfigActivity act, int objectOrdinal) |
| 118 | 118 |
{
|
| 119 |
int height = act.getScreenHeightInPixels();
|
|
| 120 |
float textSize = height*TEXT_RATIO;
|
|
| 121 |
int padding = (int)(height*PADDING_RATIO);
|
|
| 119 |
int width = act.getScreenWidthInPixels();
|
|
| 120 |
float textSize = width*TEXT_RATIO;
|
|
| 121 |
int padding = (int)(width*PADDING_RATIO);
|
|
| 122 | 122 |
|
| 123 | 123 |
LinearLayout configLayout = act.findViewById(R.id.configLayout); |
| 124 | 124 |
LinearLayout nameLayout = configLayout.findViewById(R.id.configLayoutName); |
Also available in: Unified diff
Add info about FPS.