A convenient shortcut constructor for the image sprite that works in adaptive scene.
A convenient shortcut constructor for the image sprite that works in adaptive scene.
Instead of concrete XY-coordinates this method takes two functions that each takes an instance of CPCanvas class and produce X or Y coordinate. This way this image sprite can update its position on the canvas on each frame. See CPScene on details about adaptive scenes.
Value parameters
collidable
Whether or not this sprite has a collision shape. Default is false.
id
ID of the sprite.
img
The image to render. It can be changed later.
shaders
Optional sequence of shaders for this sprite. Default value is an empty sequence.
tags
Optional set of organizational or grouping tags. By default, the empty set is used.
xf
X-coordinate producing function that takes CPCanvas parameter.
yf
Y-coordinate producing function that takes CPCanvas parameter.