Connect IQ > APIメモ > Toybox > Graphics > Dc

下位ページ

Content

Class: Toybox::Graphics::Dc


Overview

This class represents a device context. It provides methods to perform drawing operations on the device.

  • Since : 1.0.0

関数(要約) Dc

  • (Object) clear : Erase the screen using the background color by calling clear().
  • (Object) drawArc(x, y, r, attr, degreeStart, degreeEnd) : Use drawArc() to draw an arc.
  • (Object) drawBitmap(x, y, rez) : Draw a bitmap to the screen with drawBitmap().
  • (Object) drawCircle(x, y, radius) : Use drawCircle() to draw a circle around a point.
  • (Object) drawEllipse(x, y, a, b) : Use drawEllispe() to draw an ellipse around a point.
  • (Object) drawLine(x1, y1, x2, y2) : Draw a line between two points using drawLine().
  • (Object) drawPoint(x, y) : Draw a point on the screen with drawPoint().
  • (Object) drawRectangle(x, y, width, height) : 塗りつぶさない長方形を描画する
  • (Object) drawRoundedRectangle(x, y, width, height, radius) : Draw a rounded rectangle with drawRoundedRectangle().
  • (Object) drawText(x, y, font, text, justification) : テキストを指示された場所に表示する
  • (Object) fillCircle(x, y, radius) : Fill a circle with the foreground color using fillCircle().
  • (Object) fillEllipse(x, y, a, b) : Fill an ellipse with the foreground color using fillEllipse().
  • (Object) fillPolygon(pts) : To fill a polygon, use fillPolygon().
  • (Object) fillRectangle(x, y, width, height) : 前景色で塗りつぶした長方形を描画する
  • (Object) fillRoundedRectangle(x, y, width, height, radius) : Fill a rounded rectangle with the foreground color using fillRoundedRectangle().
  • (Number) getFontHeight(font) : Get The Font Height by using getFontHeight().
  • (Number) getWidth : 画面の幅を取得する
  • (Number) getHeight : 画面の高さを取得する
  • (Array) getTextDimensions(text, font) : Get the width and height of a string.
  • (Number) getTextWidthInPixels(text, font) : Get the width of a string with getTextWidthInPixels().
  • (Object) setColor(foreground, background) : Use setColor() to set the current foreground and background colors.
  • (Object) setPenWidth(width) : Use setPenWidth() to set the width of a line.

関数(詳細) Dc

(Object) clear() : 背景色で塗りつぶして、スクリーン消去を実行する

  • Since : 1.0.0

(Object) drawArc(x, y, r, attr, degreeStart, degreeEnd)

Use drawArc() to draw an arc. 0 degree: 3 o'clock position. 90 degrees: 12 o'clock position. 180 degrees: 9 o'clock position. 270 degrees: 6 o'clock position.
  • Parameters
    • x (Number) : X location of arc center
    • y (Number) : Y location of arc center
    • r (Number) : radius of arc.
    • attr (Number) : Arc drawing attributes. (ARC_COUNTER_CLOCKWISE or ARC_CLOCKWISE)
    • degreeStart (Number) : The start angle of the arc by degrees.
    • degreeEnd (Number) : The end angle of the arc by degrees.
  • Since : 1.2.0

(Object) drawBitmap(x, y, rez)

Draw a bitmap to the screen with drawBitmap().

  • Parameters:
    • x (Number) : Top left X coordinate to begin the draw
    • y (Number) : Top left Y coordinate to begin the draw
    • rez (Symbol) : The bitmap resource to draw
  • Since : 1.0.0

(Object) drawCircle(x, y, radius)

Use drawCircle() to draw a circle around a point.

  • Parameters
    • x (Number) : X location of circle center
    • y (Number) : Y location of circle center
    • radius (Number) : Radius of circle
  • Since : 1.0.0

(Object) drawEllipse(x, y, a, b)

Use drawEllispe() to draw an ellipse around a point.
  • Parameters
    • x (Number) : X location of ellipse center
    • y (Number) : Y location of ellipse center
    • a (Number) : The radius of the ellipse along the x axis
    • b (Number) : The radius of the ellipse along the y axis
  • Since : 1.0.0

(Object) drawLine(x1, y1, x2, y2) : 2点間に線を引く

  • Parameters
    • x1 (Number) : 1点目のX
    • y1 (Number) : 1点目のY
    • x2 (Number) : 2点目のX
    • y2 (Number) : 2点目のY
  • Since : 1.0.0

(Object) drawPoint(x, y) : 点を描画する

  • Parameters
    • x (Number) : X location of point
    • y (Number) : Y location of point
  • Since : 1.0.0

(Object) drawRectangle(x, y, width, height) : 塗りつぶさない長方形を描画する

  • Parameters:
    • x (Number) : 左上のX位置
    • y (Number) : 左上のY位置
    • width (Number) : 横幅
    • height (Number) : 縦幅
  • Since : 1.0.0

(Object) drawRoundedRectangle(x, y, width, height, radius) : 角丸の長方形を描画する

  • Parameters
    • x (Number) : X location of upper corner
    • y (Number) : Y location of upper corner
    • width (Number) : Width value of rectangle
    • height (Number) : Height value of rectangle
    • radius (Number) : Radius of rounding.
  • Since : 1.0.0

(Object) drawText(x, y, font, text, justification) : テキストを指示された場所に表示する

  • Parameters
    • x (Number) : X位置(justification でテキストのどこに合わせるかを決める)
    • y (Number) : Y位置(justification でテキストのどこに合わせるかを決める)
    • font (Number) : フォント(サイズ)。リソースの指定、もしくはGraphics.FONT_XXX
    • text (Number) : 文字列
    • justification : Graphics.TEXT_JUSTIFY_XXX(定数)
  • Since : 1.0.0

(Object) fillCircle(x, y, radius) : 前景色で塗りつぶされた丸を描画する

  • Parameters
    • x (Number) : X location of circle center
    • y (Number) : Y location of circle center
    • radius (Number) : Radius of circle
  • Since : 1.0.0

(Object) fillEllipse(x, y, a, b) : 前景色で塗りつぶした楕円を描く

  • Parameters
    • x (Number) : 中心のX位置
    • y (Number) : 中心のY位置
    • a (Number) : The radius of the ellipse along the x axis
    • b (Number) : The radius of the ellipse along the y axis
  • Since : 1.0.0

(Object) fillPolygon(pts) : 前景色で塗りつぶした多角形を描く

  • Parameters
    • pts (Array) : Array of coordinates with a 64 point limit
  • Since : 1.0.0

(Object) fillRectangle(x, y, width, height) : 前景色で塗りつぶした長方形を描画する

  • Parameters
    • x (Number) : 左上のX位置
    • y (Number) : 左上のY位置
    • width (Number) : 横幅
    • height (Number) : 縦幅
  • Since : 1.0.0

(Object) fillRoundedRectangle(x, y, width, height, radius) : 前景色で塗りつぶした角丸の長方形を描く

  • Parameters
    • x (Number) : 左上のX位置
    • y (Number) : Y location of upper corner
    • width (Number) : Width value of rectangle
    • height (Number) : Height value of rectangle
    • radius (Number) : Radius of rounding
  • Since : 1.0.0

(Number) getFontHeight(font) : フォントの高さを取得する

  • Parameters
    • font (Number) : Font to use
  • Returns : (Number) The height of the font
  • Since : 1.0.0

(Number) getWidth : 画面の幅を取得する

  • Returns : (Number) ディスプレイ幅
  • Since : 1.0.0

機種
ForeAthlete920XT 205

(Number) getHeight : 画面の高さを取得する

  • Returns : (Number) Height of display
  • Since : 1.0.0

機種
ForeAthlete920XT 148

(Array) getTextDimensions(text, font) : 文字列の幅、高さを取得する

幅、高さ、は行数を考慮して決められる。ある文字列が2回改行する場合は、高さは3行分、幅は最大幅が返る。
  • Parameters
    • text (String) : Text to get width for
    • font : FONT constant or font resource of text
  • Returns : (Array) width, height of string in pixels
  • Since : 1.0.0

(Number) getTextWidthInPixels(text, font) : 文字列の表示幅を Pixel 値で取得する

  • Parameters
    • text (String) : Text to get width for
    • font : FONT 定数値 or font resource of text
  • Returns : (Number) Width of string in pixels
  • Since : 1.0.0

(Object) setColor(foreground, background) : 前景色、背景色を設定する

  • Parameters
    • foreground : Graphics.COLOR_* (定数値) or 24-bit integer of the form 0xRRGGBB
    • background : Graphics.COLOR_* (定数値) or 24-bit integer of the form 0xRRGGBB
  • Since : 1.0.0

(Object) setPenWidth(width)

Use setPenWidth() to set the width of a line
  • Parameters
    • width (Number) : in pixels
  • Since : 1.0.0
最終更新:2016年03月12日 22:19