Game apps for smartphones and tablets |
|
Research project PHBern |
The class GGPanel that is included in the class library JDroidLib, provides a graph window with problem adapted coordinates (decimals) and many elemental graphical methods. With GGPanel , easy graphs as well as complicated applications can be programd. The graph methods of the class GGPanel largely correspond to the methods of the class GPanel. Therewith, GPanel applications can be reprogramd easily to Android apps. |
Example 1: Linienschar when using a for-loop
|
![]() |
extends GameGrid | The graph window is at the same time a GameGrid window |
GGPanel p = getPanel(0, 40, 0, 40); | Determines the coordinates of the graph window |
p.line(x1, y1, x2, y2); | Draws a line with the starting point (x1, y1) und endpoint (x2, y2) |
Example 2: Using colors
|
![]() |
import android.graphics.Color | Instead of using "import java.awt.Color" there has to be imported "android.graphics.Color" for Android applications that use colors |
p.setPaintColor(Color.GREEN) | Sets the characters color to green |