LayerToCanvas/CanvasToLayer example

6

Attached Files

The following files have been attached to this tutorial:

.capx

layertocanvas-canvastolayer-example.capx

Download now 172.7 KB

Stats

4,237 visits, 6,275 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 20 Sep, 2014. Last updated 19 Feb, 2019

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
  • 1 Comments

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