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.
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
Version 1.0.0. Published December 28, 2015
Created with GameMaker: Studio v1.4.1657
You can only review assets you've bought.
Doesn't work on GMS2
Any chance of updating for GMS2? The problem as far as I can see is that GMS2 doesn't have the option to use sprites as 3D the same way GMS1 allows you to choose, anyway to fix this?
This asset was developed for GMS1 before GMS2 was available. When I get a chance, I'll look into the option of setting it up for GMS2.
Just purchased your assety and it is exactly what I was looking for the game I am working on which will be using physical terrain.
Good to hear! Thanks!
Works almost perfectly
Hi, thanks for sharing this asset. It's very easy to use. I'm having one issue where a space is sometimes being drawn between the tiles (as in this picture: http://i.imgur.com/UcRhqZA.png). This seems to happen when I try to resize the tile asset. Do you have any idea why this is happening? I'm using Game Maker Studio 2. Thank you!
EDIT: I realized that the issue was due to the sprite being a size that wasn't a power of 2. It had to be changed from 48x48 to 64x64. Also, make sure that if you're using this asset that you set the sprite to have a separate texture page.
Yes. You got it! Anytime that you are drawing a continuously-tiled texture, the sprite or background needs to be a power of 2 and you will need to select the "Used for 3D" option in the editor.
As I can do to make something like what I show in the picture
the-law (path = 1) is cut and begins on the other side
You could easily draw two separate paths and get the effect that you are wanting. That will be much better than trying to define a gap that is not drawn in a single path.