Phaser API Documentation

  Version: 
Only webGL rope(x, y, texture, [frame], [points], [horizontal], [colors], [alphas])

Description:

Creates a new Rope Game Object and adds it to the Scene.

Note: This method will only be available if the Rope Game Object and WebGL support have been built into Phaser.

Parameters:

name type arguments Default description
x number

The horizontal position of this Game Object in the world.

y number

The vertical position of this Game Object in the world.

texture string | Phaser.Textures.Texture

The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager.

frame string | number <optional>

An optional frame from the Texture this Game Object is rendering with.

points Array.<Phaser.Types.Math.Vector2Like> <optional>

An array containing the vertices data for this Rope. If none is provided a simple quad is created. See setPoints to set this post-creation.

horizontal boolean <optional> true

Should the vertices of this Rope be aligned horizontally (true), or vertically (false)?

colors Array.<number> <optional>

An optional array containing the color data for this Rope. You should provide one color value per pair of vertices.

alphas Array.<number> <optional>

An optional array containing the alpha data for this Rope. You should provide one alpha value per pair of vertices.

Returns:
Description:

The Game Object that was created.

Since: 3.23.0