JScratch
Loading...
Searching...
No Matches
generated.BSprite Class Reference
Inheritance diagram for generated.BSprite:
com.jscratch.Sprite com.jscratch.ScratchObject generated.Sprite1

Public Member Functions

 BSprite (String name)
void update ()
void goTo (int x, int y)
void changeY (int y)
void changeX (int x)
void walk (int steps)
void goToFront ()
void goToBack ()
boolean isDirEqualTo (int dir)
void animateTurn (int dir, double time)
void animateTurn (int dir, double time, String curveType)
boolean isOnStage ()
void resetCostumes ()
Public Member Functions inherited from com.jscratch.Sprite
 Sprite (String name)
void setStage (Stage stage)
double getX ()
double getY ()
double getScaleX ()
double getScaleY ()
double getWidth ()
double getHeight ()
void whenClicked (Runnable action)
void whenScaleChanged (java.util.function.BiConsumer< Double, Double > action)
boolean containsPoint (int mx, int my)
void handleMouseClick (int mx, int my)
void handleScaleChange (double oldScale, double newScale)
void draw (Graphics2D g)
double width ()
double height ()
void setScaleX (double sx)
void setScaleY (double sy)
Rectangle getBounds ()
void move (double steps)
void turnRight (double deg)
void turnLeft (double deg)
void pointInDirection (double dir)
void goTo (double x, double y)
void changeXBy (double dx)
void changeYBy (double dy)
void glide (double sec, double tx, double ty)
void goToRandomPosition ()
void ifOnEdgeBounce ()
void setEffect (String effect, double value)
void changeEffectBy (String effect, double amount)
void clearGraphicsEffects ()
void say (String text)
void say (String text, double sec)
void switchCostume (String n)
void nextCostume ()
void setSize (double s)
void changeSizeBy (double a)
void show ()
void hide ()
boolean isVisible ()
void addCostume (Costume c)
boolean isTouching (Sprite o)
boolean isTouchingColor (Color c)
void setRotationStyle (RotationStyle s)
Object getVariable (String name)
Public Member Functions inherited from com.jscratch.ScratchObject
 ScratchObject (String name)
String getName ()
void setVariable (String name, Object value)
double getVariableAsNumber (String name)
String getVariableAsString (String name)
String answer ()
void changeVariableBy (String name, double amount)
List< Object > getList (String name)
void addToList (String listName, Object item)
void deleteFromList (String listName, int index)
Object itemOfList (String listName, int index)
int pickRandom (int min, int max)
String join (Object a, Object b)
String letterOf (int index, String text)
int lengthOf (String text)
void startScript (Runnable script)
void broadcast (String message)
void whenIReceive (String message, Runnable action)
void whenKeyPressed (int keyCode, Runnable action)
void waitTillNextFrame ()
void wait (double sec)
void playSound (String soundPath)
void stopAllSounds ()
void setVolume (double percent)

Public Attributes

int xx = 0
int yy = 0
int scale = 1

Private Member Functions

double applyCurve (double t, String type)

Additional Inherited Members

Static Public Member Functions inherited from com.jscratch.Sprite
static BufferedImage createPlaceholder (Color c, int w, int h)
Protected Member Functions inherited from com.jscratch.ScratchObject
double castToDouble (Object o)
String castToString (Object o)
Protected Attributes inherited from com.jscratch.ScratchObject
String name
Map< String, Object > variables = new ConcurrentHashMap<>()
Map< String, List< Object > > lists = new ConcurrentHashMap<>()
double volume = 100
List< Thread > activeScripts = new CopyOnWriteArrayList<>()

Detailed Description

Definition at line 9 of file BSprite.java.

Constructor & Destructor Documentation

◆ BSprite()

generated.BSprite.BSprite ( String name)

Definition at line 17 of file BSprite.java.

Member Function Documentation

◆ animateTurn() [1/2]

void generated.BSprite.animateTurn ( int dir,
double time )

Definition at line 80 of file BSprite.java.

◆ animateTurn() [2/2]

void generated.BSprite.animateTurn ( int dir,
double time,
String curveType )

Definition at line 113 of file BSprite.java.

◆ applyCurve()

double generated.BSprite.applyCurve ( double t,
String type )
private

Definition at line 151 of file BSprite.java.

◆ changeX()

void generated.BSprite.changeX ( int x)

Definition at line 58 of file BSprite.java.

◆ changeY()

void generated.BSprite.changeY ( int y)

Definition at line 53 of file BSprite.java.

◆ goTo()

void generated.BSprite.goTo ( int x,
int y )

Definition at line 47 of file BSprite.java.

◆ goToBack()

void generated.BSprite.goToBack ( )

Definition at line 70 of file BSprite.java.

◆ goToFront()

void generated.BSprite.goToFront ( )

Definition at line 66 of file BSprite.java.

◆ isDirEqualTo()

boolean generated.BSprite.isDirEqualTo ( int dir)

Definition at line 74 of file BSprite.java.

◆ isOnStage()

boolean generated.BSprite.isOnStage ( )

Definition at line 163 of file BSprite.java.

◆ resetCostumes()

void generated.BSprite.resetCostumes ( )

Definition at line 182 of file BSprite.java.

◆ update()

void generated.BSprite.update ( )

Definition at line 36 of file BSprite.java.

◆ walk()

void generated.BSprite.walk ( int steps)

Definition at line 62 of file BSprite.java.

Member Data Documentation

◆ scale

int generated.BSprite.scale = 1

Definition at line 15 of file BSprite.java.

◆ xx

int generated.BSprite.xx = 0

Definition at line 13 of file BSprite.java.

◆ yy

int generated.BSprite.yy = 0

Definition at line 14 of file BSprite.java.


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