Package utilities
Class MockScreen
java.lang.Object
utilities.MockScreen
- All Implemented Interfaces:
IGameScreen
-
Field Summary
Fields inherited from interface games.stendhal.client.IGameScreen
SIZE_UNIT_PIXELS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcenter()Center the view.voidRemoves all the text entities.convertScreenViewToWorld(int x, int y) Convert screen view coordinates to world coordinates.Convert screen view coordinates to world coordinates.EntityView<?>getEntityViewAt(double x, double y) Gets an entity view at given coordinates.EntityView<?>getMovableEntityViewAt(double x, double y) Get a movable entity view at given coordinates.getTextAt(int x, int y) Get the text bubble at specific coordinates.voidPrepare screen for the next frame to be rendered and move it if needed .voidpositionChanged(double x, double y) The user position changed.voidremoveText(RemovableSprite entity) Removes a text bubble.voidsetOffline(boolean offline) Set the offline indication state.
-
Constructor Details
-
MockScreen
public MockScreen()
-
-
Method Details
-
center
public void center()Description copied from interface:IGameScreenCenter the view.- Specified by:
centerin interfaceIGameScreen
-
clearTexts
public void clearTexts()Description copied from interface:IGameScreenRemoves all the text entities.- Specified by:
clearTextsin interfaceIGameScreen
-
convertScreenViewToWorld
Description copied from interface:IGameScreenConvert screen view coordinates to world coordinates.- Specified by:
convertScreenViewToWorldin interfaceIGameScreen- Parameters:
p- The screen view coordinates.- Returns:
- World coordinates.
-
convertScreenViewToWorld
Description copied from interface:IGameScreenConvert screen view coordinates to world coordinates.- Specified by:
convertScreenViewToWorldin interfaceIGameScreen- Parameters:
x- The screen view X coordinate.y- The screen view Y coordinate.- Returns:
- World coordinates.
-
getTextAt
Description copied from interface:IGameScreenGet the text bubble at specific coordinates.- Specified by:
getTextAtin interfaceIGameScreen- Parameters:
x- Screen X coordinate.y- Screen Y world coordinate.- Returns:
- the text bubble at the given coordinate or
nullif not found.
-
nextFrame
public void nextFrame()Description copied from interface:IGameScreenPrepare screen for the next frame to be rendered and move it if needed .- Specified by:
nextFramein interfaceIGameScreen
-
positionChanged
public void positionChanged(double x, double y) Description copied from interface:IGameScreenThe user position changed. This sets the target coordinates that the screen centers on.- Specified by:
positionChangedin interfaceIGameScreen- Parameters:
x- The X coordinate (in world units).y- The Y coordinate (in world units).
-
removeText
Description copied from interface:IGameScreenRemoves a text bubble.- Specified by:
removeTextin interfaceIGameScreen- Parameters:
entity- The text to be removed.
-
setOffline
public void setOffline(boolean offline) Description copied from interface:IGameScreenSet the offline indication state.- Specified by:
setOfflinein interfaceIGameScreen- Parameters:
offline-trueif offline.
-
getEntityViewAt
Description copied from interface:IGameScreenGets an entity view at given coordinates.- Specified by:
getEntityViewAtin interfaceIGameScreen- Parameters:
x- The X world coordinate.y- The Y world coordinate.- Returns:
- The entity view, or
nullif none found.
-
getMovableEntityViewAt
Description copied from interface:IGameScreenGet a movable entity view at given coordinates.- Specified by:
getMovableEntityViewAtin interfaceIGameScreen- Parameters:
x- The X world coordinate.y- The Y world coordinate.- Returns:
- The entity view, or
nullif none found.
-