LayerToCanvas/CanvasToLayer example

  • 10 favourites

Attached Files

The following files have been attached to this tutorial:

.capx

layertocanvas-canvastolayer-example.capx

Download now 172.7 KB

Stats

1,566 visits, 2,251 views

Translations

This tutorial hasn't been translated.

Tools

Simple example how to project position from another layer using LayerToCanvas and CanvasToLayer expressions.

Setting Sprite position from "UI" layer (parallax 0,0) to Player Sprite in "level" layer (parallax 100,100)

Set X position

    CanvasToLayerX("UI",LayerToCanvasX("level", Player.x, Player.y) ,LayerToCanvasY("level", Player.x, Player.y))


Set Y position

    CanvasToLayerY("UI",LayerToCanvasX("level", Player.x, Player.y) ,LayerToCanvasY("level", Player.x, Player.y))

Simple example file attached.

.CAPX

layertocanvas-canvastolayer-example.capx

Download now 172.7 KB
  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!