AI2 Component
(Version nb184)
|
Classes | |
interface | ExtensionGestureDetector |
class | FlingGestureListener |
class | MotionEventParser |
Public Member Functions | |
Canvas (ComponentContainer container) | |
void | Initialize () |
View | getView () |
Activity | getContext () |
void | registerCustomGestureDetector (ExtensionGestureDetector detector) |
void | removeCustomGestureDetector (Object detector) |
boolean | ready () |
Activity | $context () |
Form | $form () |
void | $add (AndroidViewComponent component) |
void | setChildWidth (AndroidViewComponent component, int width) |
void | setChildHeight (AndroidViewComponent component, int height) |
void | Width (int width) |
void | Height (int height) |
int | BackgroundColor () |
void | BackgroundColor (int argb) |
String | BackgroundImage () |
void | BackgroundImage (String path) |
void | BackgroundImageinBase64 (String imageUrl) |
int | PaintColor () |
void | PaintColor (int argb) |
float | FontSize () |
void | FontSize (float size) |
float | LineWidth () |
void | LineWidth (float width) |
int | TextAlignment () |
void | TextAlignment (int alignment) |
boolean | ExtendMovesOutsideCanvas () |
void | ExtendMovesOutsideCanvas (boolean extend) |
void | Touched (float x, float y, boolean touchedAnySprite) |
void | TouchDown (float x, float y) |
void | TouchUp (float x, float y) |
void | Flung (float x, float y, float speed, float heading, float xvel, float yvel, boolean flungSprite) |
void | Dragged (float startX, float startY, float prevX, float prevY, float currentX, float currentY, boolean draggedAnySprite) |
void | Clear () |
void | DrawPoint (int x, int y) |
void | DrawCircle (int centerX, int centerY, float radius, boolean fill) |
void | DrawLine (int x1, int y1, int x2, int y2) |
void | DrawShape (YailList pointList, boolean fill) |
void | DrawArc (int left, int top, int right, int bottom, float startAngle, float sweepAngle, boolean useCenter, boolean fill) |
void | DrawText (String text, int x, int y) |
void | DrawTextAtAngle (String text, int x, int y, float angle) |
int | GetBackgroundPixelColor (int x, int y) |
void | SetBackgroundPixelColor (int x, int y, @IsColor int color) |
int | GetPixelColor (int x, int y) |
String | Save () |
String | SaveAs (String fileName) |
Public Member Functions inherited from com.google.appinventor.components.runtime.AndroidViewComponent | |
boolean | Visible () |
void | Visible (boolean visibility) |
int | Width () |
void | WidthPercent (int pCent) |
void | setLastWidth (int width) |
int | getSetWidth () |
void | setLastHeight (int height) |
int | getSetHeight () |
void | CopyWidth (AndroidViewComponent sourceComponent) |
int | Height () |
void | HeightPercent (int pCent) |
void | CopyHeight (AndroidViewComponent sourceComponent) |
int | Column () |
void | Column (int column) |
int | Row () |
void | Row (int row) |
HandlesEventDispatching | getDispatchDelegate () |
Public Member Functions inherited from com.google.appinventor.components.runtime.ComponentContainer | |
int | Width () |
int | Height () |
Protected Member Functions | |
void | findSpriteCollisions (Sprite movedSprite) |
Protected Member Functions inherited from com.google.appinventor.components.runtime.AndroidViewComponent | |
AndroidViewComponent (ComponentContainer container) | |
Protected Member Functions inherited from com.google.appinventor.components.runtime.VisibleComponent | |
VisibleComponent () | |
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 = "" |
Protected Attributes inherited from com.google.appinventor.components.runtime.AndroidViewComponent | |
final ComponentContainer | container |
A two-dimensional touch-sensitive rectangular panel on which drawing can be done and sprites can be moved.
The BackgroundColor(), PaintColor(), BackgroundImage(), Width(), and Height() of the Canvas
can be set in either the Designer or in the Blocks Editor. The Width
and Height
are measured in pixels and must be positive.
Any location on the Canvas
can be specified as a pair of (X, Y)
values, where
Canvas
Canvas
There are events to tell when and where a Canvas
has been touched or a Sprite (ImageSprite or Ball) has been dragged. There are also methods for drawing points, lines, circles, shapes, arcs, and text.
@internaldoc
Conceptually, a sprite consists of the following layers, from back to front (with items in front being drawn on top):
To the user, the first three layers are all the background, in terms of the behavior of SetBackgroundPixelColor(int,int,int) and GetBackgroundPixelColor(int,int). For historical reasons, changing the background color or image clears the drawing layer.
Definition at line 132 of file Canvas.java.
com.google.appinventor.components.runtime.Canvas.Canvas | ( | ComponentContainer | container | ) |
Definition at line 750 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.$add | ( | AndroidViewComponent | component | ) |
Adds a component to a container.
After this method is finished executing, the given component's view must have LayoutParams, even if the component cannot be added to the container until later.
component | component associated with view |
Implements com.google.appinventor.components.runtime.ComponentContainer.
Definition at line 882 of file Canvas.java.
Activity com.google.appinventor.components.runtime.Canvas.$context | ( | ) |
Returns the activity context (which can be retrieved from the root container - aka the form).
Implements com.google.appinventor.components.runtime.ComponentContainer.
Definition at line 872 of file Canvas.java.
Form com.google.appinventor.components.runtime.Canvas.$form | ( | ) |
Returns the form that ultimately contains this container.
Implements com.google.appinventor.components.runtime.ComponentContainer.
Definition at line 877 of file Canvas.java.
int com.google.appinventor.components.runtime.Canvas.BackgroundColor | ( | ) |
Returns the button's background color as an alpha-red-green-blue integer, i.e.,
. An alpha of
indicates fully transparent and
means opaque.
Definition at line 1021 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.BackgroundColor | ( | int | argb | ) |
Specifies the Canvas's background color as an alpha-red-green-blue integer, i.e.,
. An alpha of
indicates fully transparent and
means opaque. The background color only shows if there is no background image.
argb | background color in the format 0xAARRGGBB, which includes alpha, red, green, and blue components |
Definition at line 1037 of file Canvas.java.
String com.google.appinventor.components.runtime.Canvas.BackgroundImage | ( | ) |
Returns the path of the canvas background image.
Definition at line 1049 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.BackgroundImage | ( | String | path | ) |
Specifies the name of a file containing the background image for the Canvas
.
@internaldoc
See MediaUtil#determineMediaSource for information about what a path can be.
path | the path of the canvas background image |
Definition at line 1065 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.BackgroundImageinBase64 | ( | String | imageUrl | ) |
Specifies the backgound image in Base64 format imageUrl will be in format of: iVBORw0KG...s//f+4z/6Z @suppressdoc
imageUrl | the base64 format for an image |
Definition at line 1080 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.Clear | ( | ) |
Clears the canvas, without removing the background image, if one was provided.
Definition at line 1344 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.Dragged | ( | float | startX, |
float | startY, | ||
float | prevX, | ||
float | prevY, | ||
float | currentX, | ||
float | currentY, | ||
boolean | draggedAnySprite | ||
) |
When the user does a drag from one point (prevX, prevY) to another (x, y). The pair (startX, startY) indicates where the user first touched the screen, and "draggedAnySprite" indicates whether a sprite is being dragged.
startX | the starting x-coordinate |
startY | the starting y-coordinate |
prevX | the previous x-coordinate (possibly equal to startX) |
prevY | the previous y-coordinate (possibly equal to startY) |
currentX | the current x-coordinate |
currentY | the current y-coordinate |
draggedAnySprite |
Definition at line 1330 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.DrawArc | ( | int | left, |
int | top, | ||
int | right, | ||
int | bottom, | ||
float | startAngle, | ||
float | sweepAngle, | ||
boolean | useCenter, | ||
boolean | fill | ||
) |
Draw an arc on Canvas, by drawing an arc from a specified oval (specified by left, top, right & bottom). Start angle is 0 when heading to the right, and increase when rotate clockwise. When useCenter is true, a sector will be drawed instead of an arc. When fill is true, a filled arc (or sector) will be drawed instead of just an outline.
left | the left end of the oval |
top | the top of the oval |
right | the right end of the oval |
bottom | the bottom of the oval |
startAngle | the start angle of the arc, rightward as 0, clockwise as positive, in degree |
sweepAngle | the sweep angle of the arc, clockwise as positive, in degree |
useCenter | fill a sector instead of just an arc (when true) |
fill | true for filled arc (or sector); false for outline only |
Definition at line 1495 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.DrawCircle | ( | int | centerX, |
int | centerY, | ||
float | radius, | ||
boolean | fill | ||
) |
Draws a circle (filled in) with the given radius centered at the given coordinates on the Canvas.
centerX | x-coordinate of the center of the circle |
centerY | y-coordinate of the center of the circle |
radius | radius of the circle |
fill | true for filled circle; false for circle outline |
Definition at line 1372 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.DrawLine | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Draws a line between the given coordinates on the canvas.
x1 | x coordinate of first point |
y1 | y coordinate of first point |
x2 | x coordinate of second point |
y2 | y coordinate of second point |
Definition at line 1391 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.DrawPoint | ( | int | x, |
int | y | ||
) |
Draws a point at the given coordinates on the canvas.
x | x coordinate |
y | y coordinate |
Definition at line 1355 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.DrawShape | ( | YailList | pointList, |
boolean | fill | ||
) |
Draws a shape on the canvas. pointList should be a list contains sub-lists with two number which represents a coordinate. The first point and last point does not need to be the same. e.g. ((x1 y1) (x2 y2) (x3 y3)) When fill is true, the shape will be filled.
pointList | A list of points, should contains sub-lists with two number which represents a coordinate. The first point and last point does not need to be the same. e.g. ((x1 y1) (x2 y2) (x3 y3)) |
fill | true for filled shape; false for shape outline |
Definition at line 1415 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.DrawText | ( | String | text, |
int | x, | ||
int | y | ||
) |
Draws the specified text relative to the specified coordinates using the values of the FontSize(float) and TextAlignment(int) properties.
text | the text to draw |
x | the x-coordinate of the origin |
y | the y-coordinate of the origin |
Definition at line 1518 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.DrawTextAtAngle | ( | String | text, |
int | x, | ||
int | y, | ||
float | angle | ||
) |
Draws the specified text starting at the specified coordinates at the specified angle using the values of the FontSize(float) and TextAlignment(int) properties.
text | the text to draw |
x | the x-coordinate of the origin |
y | the y-coordinate of the origin |
angle | the angle (in degrees) at which to draw the text |
Definition at line 1538 of file Canvas.java.
boolean com.google.appinventor.components.runtime.Canvas.ExtendMovesOutsideCanvas | ( | ) |
Definition at line 1231 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.ExtendMovesOutsideCanvas | ( | boolean | extend | ) |
|
protected |
Checks if the given sprite now overlaps with or abuts any other sprite or has ceased to do so. If there is a sprite that is newly in collision with it, Sprite#CollidedWith(Sprite) is called for each sprite with the other sprite as an argument. If two sprites that had been in collision are no longer colliding, Sprite#NoLongerCollidingWith(Sprite) is called for each sprite with the other as an argument. Collisions are only recognized between sprites that are both com.google.appinventor.components.runtime.Sprite#Visible() and com.google.appinventor.components.runtime.Sprite#Enabled().
movedSprite | the sprite that has just changed position |
Definition at line 927 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.Flung | ( | float | x, |
float | y, | ||
float | speed, | ||
float | heading, | ||
float | xvel, | ||
float | yvel, | ||
boolean | flungSprite | ||
) |
When a fling gesture (quick swipe) is made on the canvas: 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. The value "flungSprite" is true if a sprite was located near the the starting point of the fling gesture.
x | x-coordinate of touched point |
y | y-coordinate of touched point |
speed | the speed of the fling sqrt(xspeed^2 + yspeed^2) |
heading | the heading of the fling |
xvel | the speed in x-direction of the fling |
yvel | the speed in y-direction of the fling |
flungSprite |
Definition at line 1307 of file Canvas.java.
float com.google.appinventor.components.runtime.Canvas.FontSize | ( | ) |
Definition at line 1135 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.FontSize | ( | float | size | ) |
Specifies the font size of text drawn on the Canvas.
size |
Definition at line 1147 of file Canvas.java.
int com.google.appinventor.components.runtime.Canvas.GetBackgroundPixelColor | ( | int | x, |
int | y | ||
) |
Gets the color of the given pixel, ignoring sprites.
x | the x-coordinate |
y | the y-coordinate |
Definition at line 1556 of file Canvas.java.
Activity com.google.appinventor.components.runtime.Canvas.getContext | ( | ) |
Definition at line 796 of file Canvas.java.
int com.google.appinventor.components.runtime.Canvas.GetPixelColor | ( | int | x, |
int | y | ||
) |
Gets the color of the given pixel, including sprites.
x | the x-coordinate |
y | the y-coordinate |
Definition at line 1591 of file Canvas.java.
View com.google.appinventor.components.runtime.Canvas.getView | ( | ) |
Returns the View that is displayed in the UI.
Reimplemented from com.google.appinventor.components.runtime.AndroidViewComponent.
Definition at line 792 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.Height | ( | int | height | ) |
Specifies the type%
's vertical height, measured in pixels.
@internaldoc The height can only be set to >0 or -1 (automatic) or -2 (fill parent) or to a value less then or equal to LENGTH_PERCENT_TAG (which is later converted to pixels.
height |
Reimplemented from com.google.appinventor.components.runtime.AndroidViewComponent.
Definition at line 997 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.Initialize | ( | ) |
Definition at line 773 of file Canvas.java.
float com.google.appinventor.components.runtime.Canvas.LineWidth | ( | ) |
Returns the currently specified stroke width
Definition at line 1159 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.LineWidth | ( | float | width | ) |
Specifies the width of lines drawn on the Canvas.
width |
Definition at line 1171 of file Canvas.java.
int com.google.appinventor.components.runtime.Canvas.PaintColor | ( | ) |
Returns the currently specified paint color as an alpha-red-green-blue integer, i.e.,
. An alpha of
indicates fully transparent and
means opaque.
Definition at line 1101 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.PaintColor | ( | int | argb | ) |
Specifies the paint color as an alpha-red-green-blue integer, i.e.,
. An alpha of
indicates fully transparent and
means opaque.
argb | paint color in the format 0xAARRGGBB, which includes alpha, red, green, and blue components |
Definition at line 1116 of file Canvas.java.
boolean com.google.appinventor.components.runtime.Canvas.ready | ( | ) |
Returns whether the layout associated with this view has been computed. If so, Width() and Height() will be properly initialized.
Definition at line 820 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.registerCustomGestureDetector | ( | ExtensionGestureDetector | detector | ) |
Definition at line 801 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.removeCustomGestureDetector | ( | Object | detector | ) |
Definition at line 806 of file Canvas.java.
String com.google.appinventor.components.runtime.Canvas.Save | ( | ) |
Saves a picture of this Canvas to the device's external storage. If an error occurs, the Screen's ErrorOccurred event will be called.
Definition at line 1608 of file Canvas.java.
String com.google.appinventor.components.runtime.Canvas.SaveAs | ( | String | fileName | ) |
Saves a picture of this Canvas to the device's external storage in the file named fileName. fileName must end with one of ".jpg", ".jpeg", or ".png" (which determines the file type: JPEG, or PNG).
Definition at line 1637 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.SetBackgroundPixelColor | ( | int | x, |
int | y, | ||
@IsColor int | color | ||
) |
Sets the color of the given pixel. This has no effect if the coordinates are out of bounds.
x | the x-coordinate |
y | the y-coordinate |
color | the color as an alpha-red-blue-green integer |
Definition at line 1572 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.setChildHeight | ( | AndroidViewComponent | component, |
int | height | ||
) |
Implements com.google.appinventor.components.runtime.ComponentContainer.
Definition at line 892 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.setChildWidth | ( | AndroidViewComponent | component, |
int | width | ||
) |
Implements com.google.appinventor.components.runtime.ComponentContainer.
Definition at line 887 of file Canvas.java.
int com.google.appinventor.components.runtime.Canvas.TextAlignment | ( | ) |
Returns the alignment of the canvas's text: center, normal (starting at the specified point in drawText()), or opposite (ending at the specified point in drawText()).
Definition at line 1191 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.TextAlignment | ( | int | alignment | ) |
Specifies the alignment of the canvas's text: center, normal (starting at the specified point in DrawText or DrawTextAtAngle(String, int, int, float)), or opposite (ending at the specified point in DrawText(String, int, int) or DrawTextAtAngle(String, int, int, float)).
alignment | one of Component#ALIGNMENT_NORMAL, Component#ALIGNMENT_CENTER or Component#ALIGNMENT_OPPOSITE |
Definition at line 1210 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.TouchDown | ( | float | x, |
float | y | ||
) |
When the user begins touching the canvas (places finger on canvas and leaves it there): provides the (x,y) position of the touch, relative to the upper left of the canvas
x | x-coordinate of the point that was touched |
y | y-coordinate of the point that was touched |
Definition at line 1271 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.Touched | ( | float | x, |
float | y, | ||
boolean | touchedAnySprite | ||
) |
When the user touches the canvas and then immediately lifts finger: provides the (x,y) position of the touch, relative to the upper left of the canvas. TouchedAnySprite is true if the same touch also touched a sprite, and false otherwise.
x | x-coordinate of the point that was touched |
y | y-coordinate of the point that was touched |
touchedAnySprite |
Definition at line 1258 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.TouchUp | ( | float | x, |
float | y | ||
) |
When the user stops touching the canvas (lifts finger after a TouchDown event): provides the (x,y) position of the touch, relative to the upper left of the canvas
x | x-coordinate of the point that was touched |
y | y-coordinate of the point that was touched |
Definition at line 1284 of file Canvas.java.
void com.google.appinventor.components.runtime.Canvas.Width | ( | int | width | ) |
Specifies the horizontal width of the type%
, measured in pixels.
@internaldoc The width can only be set to >0 or -1 (automatic) or -2 (fill parent) or to a value less then or equal to LENGTH_PERCENT_TAG (which is later converted to pixels.
width |
Reimplemented from com.google.appinventor.components.runtime.AndroidViewComponent.
Definition at line 973 of file Canvas.java.