|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectfr.umlv.platform.GameScene<S>
S - type of the sprites managed in this game.public class GameScene<S> extends java.lang.Object
Creates a frame of 320x240 with an average refreshing rates of 50ms. This object
calls successively three functions of a GameModel<S> ; namely
GameModel.applyParallaxInZone(fr.umlv.platform.Function super S>, int, int, int, int), GameModel.applyPatternsInZone(fr.umlv.platform.Function super S>, int, int, int, int) and
GameModel.applyKeyHandledSprites(fr.umlv.platform.Function super S>, long). Each of these methods provides a
Function that allows to show out S components by using GameModel.getLocation(S)
and GameModel.getImage(S) methods to the associated GameModel.
Parallax corresponds to the background that do not scroll at the same speed
than the rest. Patterns are items not handled by the KeyHandler while
KeyHandledSprites are sprites affected by the KeyHandler.
| Constructor and Description |
|---|
GameScene(GameModel<S> model)
Build a scene with its associated GameModel |
| Modifier and Type | Method and Description |
|---|---|
int |
getHeight()
Returns the current height of the frame. |
int |
getOffsetX()
Returns the current OffsetX. |
int |
getOffsetY()
Returns the current OffsetY. |
int |
getWidth()
Returns the current width of the frame. |
void |
incrementHorizontalScroll(int shift)
Alter the offsetX from shift ; used for deciding which part of the level is drawn. |
void |
incrementVerticalScroll(int shift)
Alter the offsetY from shift ; used for deciding which part of the level is drawn If the shift leads to a negative offsetY, the offsetY is set to 0. |
void |
showFrame(java.lang.String title,
KeyHandler keyHandler)
Draw a frame of 320x240 with a refreshing rates of 50ms |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GameScene(GameModel<S> model)
GameModel
model - | Method Detail |
|---|
public void incrementHorizontalScroll(int shift)
shift - public void incrementVerticalScroll(int shift)
shift -
public void showFrame(java.lang.String title,
KeyHandler keyHandler)
title - Title of the frame.keyHandler - The Handler of the KeyHandledSprites.public int getOffsetX()
int corresponding to the X-axis offsetpublic int getOffsetY()
int corresponding to the Y-axis offsetpublic int getWidth()
int corresponding to the width in pixels of the framepublic int getHeight()
int corresponding to the height in pixels of the frame
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||