# extras

# ZKButton

TIP

Extras class: A button component.

CODE:

var btn = ZKButton("assets/btn.png")
  ..setScale(.5)
  ..position.x = 100
  ..position.y = 100;
  stage.addChild(btn);

# Constructor

# Properties

Name Type Defaults Description
type String "ZKButton" Type of this node
onClick Function null Button Click Function

# Other properties are inherited from ZKNode, please check.

# Other methods are inherited from ZKNode, please check.


# ZKScrollBg

TIP

A background component that scrolls around in a loop, commonly used in games.

CODE:

var scrollbg = ZKScrollBg(image: "assets/bg.png", total: 2, direction: "left", time: 30 * 1000);
    scrollbg.anchor.y = 1;
    scrollbg.position.y = this.context.appHeight;
    stage.addChildAt(scrollbg, 0);

# Constructor

  • # ZKScrollBg

{String key,
String image,
int total,
int count = 2,
double width,
double height,
int time = DEFAULT_TIME,
String direction = 'left'}

# Properties

Name Type Defaults Description
type String "ZKScrollBg" Type of this node
onLoad Function null ZKSprite loaded successfully

# Other properties are inherited from ZKNode, please check.

# Other methods are inherited from ZKNode, please check.


# ZKCircle

TIP

A Circle component.

CODE:

var circle = ZKCircle(20.0);
circle.color = Colors.blue;

# Constructor

  • # ZKCircle(double radius, [Color: color])

    • ZKCircle inherits from ZKNode.

# Properties

Name Type Defaults Description
type String "ZKCircle" Type of this node
radius double 10 circle radius

# Other properties are inherited from ZKNode, please check.

# Other methods are inherited from ZKNode, please check.