AI2 Component  (Version nb184)
com.google.appinventor.components.runtime.Sprite Class Referenceabstract
Inheritance diagram for com.google.appinventor.components.runtime.Sprite:
com.google.appinventor.components.runtime.VisibleComponent com.google.appinventor.components.runtime.AlarmHandler com.google.appinventor.components.runtime.OnDestroyListener com.google.appinventor.components.runtime.Deleteable com.google.appinventor.components.runtime.Component com.google.appinventor.components.runtime.Ball com.google.appinventor.components.runtime.ImageSprite

Public Member Functions

void Initialize ()
 
boolean Enabled ()
 
void Enabled (boolean enabled)
 
double Heading ()
 
void Heading (double userHeading)
 
int Interval ()
 
void Interval (int interval)
 
void Speed (float speed)
 
float Speed ()
 
boolean Visible ()
 
void Visible (boolean visible)
 
double X ()
 
void X (double x)
 
void Y (double y)
 
double Y ()
 
void Z (double layer)
 
double Z ()
 
void CollidedWith (Sprite other)
 
void Dragged (float startX, float startY, float prevX, float prevY, float currentX, float currentY)
 
void EdgeReached (int edge)
 
void NoLongerCollidingWith (Sprite other)
 
void Touched (float x, float y)
 
void Flung (float x, float y, float speed, float heading, float xvel, float yvel)
 
void TouchUp (float x, float y)
 
void TouchDown (float x, float y)
 
void Bounce (int edge)
 
boolean CollidingWith (Sprite other)
 
void MoveIntoBounds ()
 
void MoveTo (double x, double y)
 
void PointTowards (Sprite target)
 
void PointInDirection (double x, double y)
 
BoundingBox getBoundingBox (int border)
 
boolean intersectsWith (BoundingBox rect)
 
boolean containsPoint (double qx, double qy)
 
void alarm ()
 
HandlesEventDispatching getDispatchDelegate ()
 
void onDestroy ()
 
void onDelete ()
 
- Public Member Functions inherited from com.google.appinventor.components.runtime.VisibleComponent
abstract int Width ()
 
abstract void Width (int width)
 
abstract void WidthPercent (int wPercent)
 
abstract int Height ()
 
abstract void Height (int height)
 
abstract void HeightPercent (int hPercent)
 

Static Public Member Functions

static boolean colliding (Sprite sprite1, Sprite sprite2)
 

Protected Member Functions

 Sprite (ComponentContainer container, Handler handler)
 
 Sprite (ComponentContainer container)
 
void OriginAtCenter (boolean b)
 
void postEvent (final Sprite sprite, final String eventName, final Object... args)
 
void registerChange ()
 
int hitEdge ()
 
final void moveIntoBounds (int canvasWidth, int canvasHeight)
 
void updateCoordinates ()
 
int hitEdge (int canvasWidth, int canvasHeight)
 
abstract void onDraw (android.graphics.Canvas canvas)
 
- Protected Member Functions inherited from com.google.appinventor.components.runtime.VisibleComponent
 VisibleComponent ()
 

Protected Attributes

final Canvas canvas
 
boolean initialized = false
 
int interval
 
boolean visible = true
 
double xLeft
 
double yTop
 
double zLayer
 
float speed
 
boolean originAtCenter
 
double xCenter
 
double yCenter
 
Form form
 
double userHeading
 
double heading
 
double headingRadians
 
double headingCos
 
double headingSin
 

Static Protected Attributes

static final boolean DEFAULT_ORIGIN_AT_CENTER = false
 

Additional Inherited Members

- Static Public Attributes inherited from com.google.appinventor.components.runtime.Component
static final String ASSET_DIRECTORY = "component"
 
static final int ALIGNMENT_NORMAL = 0
 
static final int ALIGNMENT_CENTER = 1
 
static final int ALIGNMENT_OPPOSITE = 2
 
static final int ACCELEROMETER_SENSITIVITY_WEAK = 1
 
static final int ACCELEROMETER_SENSITIVITY_MODERATE = 2
 
static final int ACCELEROMETER_SENSITIVITY_STRONG = 3
 
static final int BUTTON_SHAPE_DEFAULT = 0
 
static final int BUTTON_SHAPE_ROUNDED = 1
 
static final int BUTTON_SHAPE_RECT = 2
 
static final int BUTTON_SHAPE_OVAL = 3
 
static final int COLOR_NONE = 0x00FFFFFF
 
static final int COLOR_BLACK = 0xFF000000
 
static final int COLOR_BLUE = 0xFF0000FF
 
static final int COLOR_CYAN = 0xFF00FFFF
 
static final int COLOR_DKGRAY = 0xFF444444
 
static final int COLOR_GRAY = 0xFF888888
 
static final int COLOR_GREEN = 0xFF00FF00
 
static final int COLOR_LTGRAY = 0xFFCCCCCC
 
static final int COLOR_MAGENTA = 0xFFFF00FF
 
static final int COLOR_ORANGE = 0xFFFFC800
 
static final int COLOR_PINK = 0xFFFFAFAF
 
static final int COLOR_RED = 0xFFFF0000
 
static final int COLOR_WHITE = 0xFFFFFFFF
 
static final int COLOR_YELLOW = 0xFFFFFF00
 
static final int COLOR_DEFAULT = 0x00000000
 
static final String DEFAULT_VALUE_COLOR_NONE = "&H00FFFFFF"
 
static final String DEFAULT_VALUE_COLOR_BLACK = "&HFF000000"
 
static final String DEFAULT_VALUE_COLOR_BLUE = "&HFF0000FF"
 
static final String DEFAULT_VALUE_COLOR_CYAN = "&HFF00FFFF"
 
static final String DEFAULT_VALUE_COLOR_DKGRAY = "&HFF444444"
 
static final String DEFAULT_VALUE_COLOR_GRAY = "&HFF888888"
 
static final String DEFAULT_VALUE_COLOR_GREEN = "&HFF00FF00"
 
static final String DEFAULT_VALUE_COLOR_LTGRAY = "&HFFCCCCCC"
 
static final String DEFAULT_VALUE_COLOR_MAGENTA = "&HFFFF00FF"
 
static final String DEFAULT_VALUE_COLOR_ORANGE = "&HFFFFC800"
 
static final String DEFAULT_VALUE_COLOR_PINK = "&HFFFFAFAF"
 
static final String DEFAULT_VALUE_COLOR_RED = "&HFFFF0000"
 
static final String DEFAULT_VALUE_COLOR_WHITE = "&HFFFFFFFF"
 
static final String DEFAULT_VALUE_COLOR_YELLOW = "&HFFFFFF00"
 
static final String DEFAULT_VALUE_COLOR_DEFAULT = "&H00000000"
 
static final float FONT_DEFAULT_SIZE = 14
 
static final int LAYOUT_ORIENTATION_HORIZONTAL = ComponentConstants.LAYOUT_ORIENTATION_HORIZONTAL
 
static final int LAYOUT_ORIENTATION_VERTICAL = ComponentConstants.LAYOUT_ORIENTATION_VERTICAL
 
static final int SCALING_SCALE_PROPORTIONALLY = 0
 
static final int SCALING_SCALE_TO_FIT = 1
 
static final int TYPEFACE_DEFAULT = 0
 
static final int TYPEFACE_SANSSERIF = 1
 
static final int TYPEFACE_SERIF = 2
 
static final int TYPEFACE_MONOSPACE = 3
 
static final int LENGTH_PREFERRED = -1
 
static final int LENGTH_FILL_PARENT = -2
 
static final int LENGTH_UNKNOWN = -3
 
static final int LENGTH_PERCENT_TAG = -1000
 
static final int TOAST_LENGTH_SHORT = 0
 
static final int TOAST_LENGTH_LONG = 1
 
static final int DIRECTION_NORTH = 1
 
static final int DIRECTION_NORTHEAST = 2
 
static final int DIRECTION_EAST = 3
 
static final int DIRECTION_SOUTHEAST = 4
 
static final int DIRECTION_SOUTH = -1
 
static final int DIRECTION_SOUTHWEST = -2
 
static final int DIRECTION_WEST = -3
 
static final int DIRECTION_NORTHWEST = -4
 
static final int DIRECTION_NONE = 0
 
static final int DIRECTION_MIN = -4
 
static final int DIRECTION_MAX = 4
 
static float SLIDER_MIN_VALUE = 10
 
static float SLIDER_MAX_VALUE = 50
 
static float SLIDER_THUMB_VALUE = (SLIDER_MIN_VALUE + SLIDER_MAX_VALUE) / 2.0f
 
static final String DEFAULT_VALUE_TEXT_TO_SPEECH_COUNTRY = ""
 
static final String DEFAULT_VALUE_TEXT_TO_SPEECH_LANGUAGE = ""
 

Detailed Description

Superclass of sprites able to move and interact with other sprites.

While the Simple programmer sees the x- and y-coordinates as integers, they are maintained internally as doubles so fractional changes (caused by multiplying the speed by a cosine or sine value) have the chance to add up.

Author
spertus.google.com (Ellen Spertus)

Definition at line 37 of file Sprite.java.

Constructor & Destructor Documentation

◆ Sprite() [1/2]

com.google.appinventor.components.runtime.Sprite.Sprite ( ComponentContainer  container,
Handler  handler 
)
protected

Creates a new Sprite component. This version exists to allow injection of a mock handler for testing.

Parameters
containerwhere the component will be placed
handlera scheduler to which runnable events will be posted

Definition at line 103 of file Sprite.java.

◆ Sprite() [2/2]

com.google.appinventor.components.runtime.Sprite.Sprite ( ComponentContainer  container)
protected

Creates a new Sprite component. This is called by the constructors of concrete subclasses, such as Ball and ImageSprite.

Parameters
containerwhere the component will be placed

Definition at line 140 of file Sprite.java.

Member Function Documentation

◆ alarm()

void com.google.appinventor.components.runtime.Sprite.alarm ( )

Moves and redraws sprite, registering changes.

Implements com.google.appinventor.components.runtime.AlarmHandler.

Definition at line 990 of file Sprite.java.

◆ Bounce()

◆ CollidedWith()

void com.google.appinventor.components.runtime.Sprite.CollidedWith ( Sprite  other)

Event handler called when two enabled sprites (Balls or ImageSprites) collide. Note that checking for collisions with a rotated ImageSprite currently checks against its unrotated position. Therefore, collision checking will be inaccurate for tall narrow or short wide sprites that are rotated.

Parameters
otherthe other sprite in the collision

Definition at line 435 of file Sprite.java.

◆ colliding()

static boolean com.google.appinventor.components.runtime.Sprite.colliding ( Sprite  sprite1,
Sprite  sprite2 
)
static

Determines whether two sprites are in collision. Note that we cannot merely see whether the rectangular regions around each intersect, since some types of sprite, such as BallSprite, are not rectangular.

Parameters
sprite1one sprite
sprite2another sprite
Returns
true
if they are in collision,
false
otherwise

Definition at line 922 of file Sprite.java.

◆ CollidingWith()

boolean com.google.appinventor.components.runtime.Sprite.CollidingWith ( Sprite  other)

Indicates whether a collision has been registered between this type% and the passed other sprite.

Parameters
otherthe sprite to check for collision with this sprite
Returns
true
if a collision event has been raised for the pair of sprites and they still are in collision,
false
otherwise.

Definition at line 657 of file Sprite.java.

◆ containsPoint()

boolean com.google.appinventor.components.runtime.Sprite.containsPoint ( double  qx,
double  qy 
)

Indicates whether the specified point is contained by this sprite. Subclasses of Sprite that are not rectangular should override this method.

Parameters
qxthe x-coordinate
qythe y-coordinate
Returns
whether (qx, qy) falls within this sprite

Reimplemented in com.google.appinventor.components.runtime.Ball.

Definition at line 978 of file Sprite.java.

◆ Dragged()

void com.google.appinventor.components.runtime.Sprite.Dragged ( float  startX,
float  startY,
float  prevX,
float  prevY,
float  currentX,
float  currentY 
)

Event handler for Dragged events. On all calls, the starting coordinates are where the screen was first touched, and the "current" coordinates describe the endpoint of the current line segment. On the first call within a given drag, the "previous" coordinates are the same as the starting coordinates; subsequently, they are the "current" coordinates from the prior call. Note that the type% won't actually move anywhere in response to the Dragged event unless MoveTo(double, double) is specifically called.

Parameters
startXthe starting x-coordinate
startYthe starting y-coordinate
prevXthe previous x-coordinate (possibly equal to startX)
prevYthe previous y-coordinate (possibly equal to startY)
currentXthe current x-coordinate
currentYthe current y-coordinate

Definition at line 470 of file Sprite.java.

◆ EdgeReached()

void com.google.appinventor.components.runtime.Sprite.EdgeReached ( int  edge)

Event handler called when the type% reaches an edge{:.variable.block} of the screen. If Bounce(int) is then called with that edge, the sprite will appear to bounce off of the edge it reached. Edge here is represented as an integer that indicates one of eight directions north(1), northeast(2), east(3), southeast(4), south (-1), southwest(-2), west(-3), and northwest(-4).

Definition at line 489 of file Sprite.java.

◆ Enabled() [1/2]

boolean com.google.appinventor.components.runtime.Sprite.Enabled ( )

Controls whether the type% moves when its speed is non-zero.

Returns
true
indicates a running timer,
false
a stopped timer

Definition at line 166 of file Sprite.java.

◆ Enabled() [2/2]

void com.google.appinventor.components.runtime.Sprite.Enabled ( boolean  enabled)

Enabled property setter method: starts or stops the timer.

@suppressdoc

Parameters
enabled

Definition at line 180 of file Sprite.java.

◆ Flung()

void com.google.appinventor.components.runtime.Sprite.Flung ( float  x,
float  y,
float  speed,
float  heading,
float  xvel,
float  yvel 
)

When a fling gesture (quick swipe) is made on the sprite: provides the (x,y) position of the start of the fling, relative to the upper left of the canvas. Also provides the speed (pixels per millisecond) and heading (0-360 degrees) of the fling, as well as the x velocity and y velocity components of the fling's vector.

Parameters
xx-coordinate of touched point
yy-coordinate of touched point
speedthe speed of the fling sqrt(xspeed^2 + yspeed^2)
headingthe heading of the fling
xvelthe speed in x-direction of the fling
yvelthe speed in y-direction of the fling

Definition at line 553 of file Sprite.java.

◆ getBoundingBox()

BoundingBox com.google.appinventor.components.runtime.Sprite.getBoundingBox ( int  border)

Provides the bounding box for this sprite. Modifying the returned value does not affect the sprite.

Parameters
borderthe number of pixels outside the sprite to include in the bounding box
Returns
the bounding box for this sprite

Definition at line 908 of file Sprite.java.

◆ getDispatchDelegate()

HandlesEventDispatching com.google.appinventor.components.runtime.Sprite.getDispatchDelegate ( )

Returns the dispatch delegate that is responsible for dispatching events for this component.

Implements com.google.appinventor.components.runtime.Component.

Definition at line 1002 of file Sprite.java.

◆ Heading() [1/2]

double com.google.appinventor.components.runtime.Sprite.Heading ( )

The type%'s heading in degrees above the positive x-axis. Zero degrees is toward the right of the screen; 90 degrees is toward the top of the screen.

Returns
degrees above the positive x-axis

Definition at line 194 of file Sprite.java.

◆ Heading() [2/2]

void com.google.appinventor.components.runtime.Sprite.Heading ( double  userHeading)

Sets heading in which sprite should move. In addition to changing the local variables userHeading and heading, this sets headingCos, headingSin, and headingRadians.

@suppressdoc

Parameters
userHeadingdegrees above the positive x-axis

Definition at line 210 of file Sprite.java.

◆ hitEdge() [1/2]

int com.google.appinventor.components.runtime.Sprite.hitEdge ( )
protected

Specifies which edge of the canvas has been hit by the Sprite, if any, moving the sprite back in bounds.

Returns
Component#DIRECTION_NONE if no edge has been hit, or a direction (e.g., Component#DIRECTION_NORTHEAST) if that edge of the canvas has been hit

Definition at line 751 of file Sprite.java.

◆ hitEdge() [2/2]

int com.google.appinventor.components.runtime.Sprite.hitEdge ( int  canvasWidth,
int  canvasHeight 
)
protected

Definition at line 849 of file Sprite.java.

◆ Initialize()

void com.google.appinventor.components.runtime.Sprite.Initialize ( )

Definition at line 147 of file Sprite.java.

◆ intersectsWith()

boolean com.google.appinventor.components.runtime.Sprite.intersectsWith ( BoundingBox  rect)

Determines whether this sprite intersects with the given rectangle.

Parameters
rectthe rectangle
Returns
true
if they intersect,
false
otherwise

Definition at line 950 of file Sprite.java.

◆ Interval() [1/2]

int com.google.appinventor.components.runtime.Sprite.Interval ( )

The interval in milliseconds at which the type%'s position is updated. For example, if the Interval is 50 and the Speed(float) is 10, then the type% will move 10 pixels every 50 milliseconds.

Returns
timer interval in ms

Definition at line 232 of file Sprite.java.

◆ Interval() [2/2]

void com.google.appinventor.components.runtime.Sprite.Interval ( int  interval)

Interval property setter method: sets the interval between timer events.

@suppressdoc

Parameters
intervaltimer interval in ms

Definition at line 246 of file Sprite.java.

◆ MoveIntoBounds()

void com.google.appinventor.components.runtime.Sprite.MoveIntoBounds ( )

Moves the sprite back in bounds if part of it extends out of bounds, having no effect otherwise. If the sprite is too wide to fit on the canvas, this aligns the left side of the sprite with the left side of the canvas. If the sprite is too tall to fit on the canvas, this aligns the top side of the sprite with the top side of the canvas.

Definition at line 674 of file Sprite.java.

◆ moveIntoBounds()

final void com.google.appinventor.components.runtime.Sprite.moveIntoBounds ( int  canvasWidth,
int  canvasHeight 
)
protected

Moves the sprite back in bounds if part of it extends out of bounds, having no effect otherwise. If the sprite is too wide to fit on the canvas, this aligns the left side of the sprite with the left side of the canvas. If the sprite is too tall to fit on the canvas, this aligns the top side of the sprite with the top side of the canvas.

Definition at line 766 of file Sprite.java.

◆ MoveTo()

void com.google.appinventor.components.runtime.Sprite.MoveTo ( double  x,
double  y 
)

Moves the type% so that its left top corner is at the specified x and y coordinates.

Parameters
xthe x-coordinate
ythe y-coordinate

Reimplemented in com.google.appinventor.components.runtime.ImageSprite, and com.google.appinventor.components.runtime.Ball.

Definition at line 685 of file Sprite.java.

◆ NoLongerCollidingWith()

void com.google.appinventor.components.runtime.Sprite.NoLongerCollidingWith ( Sprite  other)

Event indicating that a pair of sprites are no longer colliding.

@internaldoc This also registers the removal of the collision to a private variable registeredCollisions so that CollidedWith(Sprite) and this event are only raised once per beginning and ending of a collision.

Parameters
otherthe sprite formerly colliding with this sprite

Definition at line 513 of file Sprite.java.

◆ onDelete()

void com.google.appinventor.components.runtime.Sprite.onDelete ( )

◆ onDestroy()

void com.google.appinventor.components.runtime.Sprite.onDestroy ( )

◆ onDraw()

abstract void com.google.appinventor.components.runtime.Sprite.onDraw ( android.graphics.Canvas  canvas)
abstractprotected

Draws the sprite on the given canvas

Parameters
canvasthe canvas on which to draw

Reimplemented in com.google.appinventor.components.runtime.ImageSprite.

◆ OriginAtCenter()

void com.google.appinventor.components.runtime.Sprite.OriginAtCenter ( boolean  b)
protected

Reimplemented in com.google.appinventor.components.runtime.Ball.

Definition at line 396 of file Sprite.java.

◆ PointInDirection()

void com.google.appinventor.components.runtime.Sprite.PointInDirection ( double  x,
double  y 
)

Turns this type% to point toward the point with the coordinates (x, y).

Parameters
xparameter of the point to turn to
yparameter of the point to turn to

Definition at line 714 of file Sprite.java.

◆ PointTowards()

void com.google.appinventor.components.runtime.Sprite.PointTowards ( Sprite  target)

Turns this type% to point towards a given target sprite. The new heading will be parallel to the line joining the centerpoints of the two sprites.

Parameters
targetthe other sprite to point towards

Definition at line 701 of file Sprite.java.

◆ postEvent()

void com.google.appinventor.components.runtime.Sprite.postEvent ( final Sprite  sprite,
final String  eventName,
final Object...  args 
)
protected

Posts a dispatch for the specified event. This guarantees that event handlers run with serial semantics, e.g., appear atomic relative to each other.

This method is overridden in tests.

Parameters
spritethe instance on which the event takes place
eventNamethe name of the event
argsthe arguments to the event handler

Definition at line 415 of file Sprite.java.

◆ registerChange()

void com.google.appinventor.components.runtime.Sprite.registerChange ( )
protected

Responds to a move or change of this sprite by redrawing the enclosing Canvas and checking for any consequences that need handling. Specifically, this (1) notifies the Canvas of a change so it can detect any collisions, etc., and (2) raises the EdgeReached(int) event if the Sprite has reached the edge of the Canvas.

Definition at line 728 of file Sprite.java.

◆ Speed() [1/2]

float com.google.appinventor.components.runtime.Sprite.Speed ( )

Gets the speed with which this sprite moves.

@suppressdoc

Returns
the magnitude (in pixels) the sprite moves every interval milliseconds.

Definition at line 276 of file Sprite.java.

◆ Speed() [2/2]

void com.google.appinventor.components.runtime.Sprite.Speed ( float  speed)

The speed at which the type% moves. The type% moves this many pixels every Interval() milliseconds if Enabled(boolean) is true{:.logic.block}.

Parameters
speedthe magnitude (in pixels) to move every interval milliseconds

Definition at line 262 of file Sprite.java.

◆ TouchDown()

void com.google.appinventor.components.runtime.Sprite.TouchDown ( float  x,
float  y 
)

When the user begins touching the sprite (places finger on sprite and leaves it there): provides the (x,y) position of the touch, relative to the upper left of the canvas

Parameters
xx-coordinate of touched point
yy-coordinate of touched point

Definition at line 585 of file Sprite.java.

◆ Touched()

void com.google.appinventor.components.runtime.Sprite.Touched ( float  x,
float  y 
)

When the user touches the sprite and then immediately lifts finger: provides the (x,y) position of the touch, relative to the upper left of the canvas.

Parameters
xx-coordinate of touched point
yy-coordinate of touched point

Definition at line 529 of file Sprite.java.

◆ TouchUp()

void com.google.appinventor.components.runtime.Sprite.TouchUp ( float  x,
float  y 
)

When the user stops touching the sprite (lifts finger after a TouchDown event): provides the (x,y) position of the touch, relative to the upper left of the canvas.

Parameters
xx-coordinate of touched point
yy-coordinate of touched point

Definition at line 569 of file Sprite.java.

◆ updateCoordinates()

void com.google.appinventor.components.runtime.Sprite.updateCoordinates ( )
protected

Updates the x- and y-coordinates based on the heading and speed. The caller is responsible for calling registerChange().

Definition at line 823 of file Sprite.java.

◆ Visible() [1/2]

boolean com.google.appinventor.components.runtime.Sprite.Visible ( )

The Visible property determines whether the type% is visible (true{:.logic.block}) or invisible (false{:.logic.block}).

Returns
true
if the sprite is visible,
false
otherwise

Definition at line 287 of file Sprite.java.

◆ Visible() [2/2]

void com.google.appinventor.components.runtime.Sprite.Visible ( boolean  visible)

Sets whether sprite should be visible.

Parameters
visible

Definition at line 301 of file Sprite.java.

◆ X() [1/2]

double com.google.appinventor.components.runtime.Sprite.X ( )

◆ X() [2/2]

void com.google.appinventor.components.runtime.Sprite.X ( double  x)

Definition at line 334 of file Sprite.java.

◆ Y() [1/2]

double com.google.appinventor.components.runtime.Sprite.Y ( )

◆ Y() [2/2]

void com.google.appinventor.components.runtime.Sprite.Y ( double  y)

Definition at line 362 of file Sprite.java.

◆ Z() [1/2]

double com.google.appinventor.components.runtime.Sprite.Z ( )

Definition at line 390 of file Sprite.java.

◆ Z() [2/2]

void com.google.appinventor.components.runtime.Sprite.Z ( double  layer)

How the type% should be layered relative to other Balls and ImageSprites, with higher-numbered layers appearing in front of lower-numbered layers.

Parameters
layerhigher numbers indicate that this sprite should appear in front of ones with lower numbers; if values are equal for sprites, either can go in front of the other

Definition at line 382 of file Sprite.java.

Member Data Documentation

◆ canvas

final Canvas com.google.appinventor.components.runtime.Sprite.canvas
protected

Definition at line 48 of file Sprite.java.

◆ DEFAULT_ORIGIN_AT_CENTER

final boolean com.google.appinventor.components.runtime.Sprite.DEFAULT_ORIGIN_AT_CENTER = false
staticprotected

Definition at line 46 of file Sprite.java.

◆ form

Form com.google.appinventor.components.runtime.Sprite.form
protected

Definition at line 76 of file Sprite.java.

◆ heading

double com.google.appinventor.components.runtime.Sprite.heading
protected

The angle, in degrees below the positive x-axis, specified by the user. We use this to compute new coordinates because, on Android, the y-coordinate increases "below" the x-axis.

Definition at line 91 of file Sprite.java.

◆ headingCos

double com.google.appinventor.components.runtime.Sprite.headingCos
protected

Definition at line 93 of file Sprite.java.

◆ headingRadians

double com.google.appinventor.components.runtime.Sprite.headingRadians
protected

Definition at line 92 of file Sprite.java.

◆ headingSin

double com.google.appinventor.components.runtime.Sprite.headingSin
protected

Definition at line 94 of file Sprite.java.

◆ initialized

boolean com.google.appinventor.components.runtime.Sprite.initialized = false
protected

Definition at line 60 of file Sprite.java.

◆ interval

int com.google.appinventor.components.runtime.Sprite.interval
protected

Definition at line 64 of file Sprite.java.

◆ originAtCenter

boolean com.google.appinventor.components.runtime.Sprite.originAtCenter
protected

Definition at line 72 of file Sprite.java.

◆ speed

float com.google.appinventor.components.runtime.Sprite.speed
protected

Definition at line 69 of file Sprite.java.

◆ userHeading

double com.google.appinventor.components.runtime.Sprite.userHeading
protected

The angle, in degrees above the positive x-axis, specified by the user. This is private in order to enforce that changing it also changes heading, headingRadians, headingCos, and headingSin.

Definition at line 84 of file Sprite.java.

◆ visible

boolean com.google.appinventor.components.runtime.Sprite.visible = true
protected

Definition at line 65 of file Sprite.java.

◆ xCenter

double com.google.appinventor.components.runtime.Sprite.xCenter
protected

Definition at line 73 of file Sprite.java.

◆ xLeft

double com.google.appinventor.components.runtime.Sprite.xLeft
protected

Definition at line 66 of file Sprite.java.

◆ yCenter

double com.google.appinventor.components.runtime.Sprite.yCenter
protected

Definition at line 74 of file Sprite.java.

◆ yTop

double com.google.appinventor.components.runtime.Sprite.yTop
protected

Definition at line 67 of file Sprite.java.

◆ zLayer

double com.google.appinventor.components.runtime.Sprite.zLayer
protected

Definition at line 68 of file Sprite.java.


The documentation for this class was generated from the following file: