Icon

Draw Sprite on Path

SCR

You must be logged in to obtain assets

Description

This script allows you to draw a Sprite along a path and have the sprite warp or conform to the path.

Examples: Draw grass on the surface of a terrain. Draw banners that scroll across the screen

There is a lot of flexibility, including:

-Scale the sprite in x and y directions.
-Position the sprite to ride on the top of the path, bottom of the path, or anywhere in between.
-Offset the sprite image to create effects such as a moving surface or an arrow following a path (see example).
-Works with Open or Closed Paths.
-Define the precision of the path.

Script:

 scr_draw_sprite_on_path(path, x, y, sprite, index, image_x_offset, image_y_offset, x_scale, y_scale, precision, absolute)

 path:             path to draw the sprite on (must be an existing path)

 x,y:              x and y offset of the position of the path

 sprite:           sprite to draw  (The sprite must be selected as 'Used for 3D' in the Sprite editor.)

 index:            sprite image index to draw

 image_x_offset:   Amount to offset the sprite image in pixels.

 image_y_offset:   Number between 0 and 1. 

      0 = top of sprite rides on the path. 

      1 = bottom of sprite rides on the path.

      0.5 = mid-sprite rides along the path 

 x_scale:           Scale the sprite width along the length of the path

      If a '0' value is entered, then the scale of the sprite will be set to length of the path 

 y_scale:           Scale the sprite height

 precision:        Size or distance of each step in pixels

 absolute:         

       '0' indicates that path will be drawn in absolute position (as defined in the path editor) and then offset by the x,y values indicated.

       '1' indicates that path will begin at the x,y position indicated

End User Licence Agreement (EULA).

Age Rating: None

Version

GMS1 - Version 1.0.0. Published December 28, 2015

Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait