java.lang.Object | ||
↳ | com.neomades.app.Screen | |
↳ | com.neomades.graphics.CanvasScreen |
A canvas screen is used to perform 2D drawing operations. By overriding the paint method, you can draw to the screen.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CanvasScreen()
Create a new CanvasScreen.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
final int |
getHeight()
Returns the height of the canvas screen in pixels.
| ||||||||||
Rect |
getScreenRect()
Returns the rectangle corresponding to the screen.
| ||||||||||
final int |
getWidth()
Returns the width of the canvas screen in pixels.
| ||||||||||
void |
refresh()
Refresh the entire screen.
| ||||||||||
void |
startAutoRefresh(int timer)
Indicates that the screen will be refreshed at a regular interval.
| ||||||||||
void |
stopAutoRefresh()
Stops the screen from being automatically refreshed.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
View |
getContent()
Cannot be called for CanvasScreen.
| ||||||||||
void |
onSizeChanged(int w, int h)
Override this method to provide a behavior when the size of the canvas screen
is changed For example, when the device is set in landscape mode.
| ||||||||||
void | onUpdate() | ||||||||||
abstract void |
paint(Graphics g)
Override this method to do the painting to the screen.
| ||||||||||
void |
setContent(View content)
Cannot be called for CanvasScreen.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Create a new CanvasScreen.
Returns the height of the canvas screen in pixels.
Returns the rectangle corresponding to the screen.
Returns the width of the canvas screen in pixels.
Refresh the entire screen.
Indicates that the screen will be refreshed at a regular interval. this will create a timer that will refresh the screen. The timer is started when this method is called.
timer | the time between two refresh call |
---|
Stops the screen from being automatically refreshed.
Override this method to provide a behavior when the size of the canvas screen is changed For example, when the device is set in landscape mode.
w | the new canvas width |
---|---|
h | the new canvas height |
Override this method to do the painting to the screen.
g | the graphics used to draw |
---|
Cannot be called for CanvasScreen.
content | the content of this screen |
---|