Description

HTML5 DEMO:
http://tice.bplaced.net/gamemaker/DrawPathSprite/index.html

Info:
With this script you'll be able to draw a Sprite along a Path with

Usage:

  1. Create a new Path (with smoothing enabled)
  2. Create a new Sprite you want to draw along the path.
  3. Call the script with your desired arguments.

Script Arguments:

  • path = path index
  • x = offset x
  • y = offset y
  • width = thickness of the path
  • sprite = sprite to use
  • spriteIndex = image index of the given sprite
  • spriteScaleX = x scale for the sprite
  • spriteScaleY = y scale for the sprite
  • color = color of the sprite
  • alpha = alpha of the sprite
  • segments = amount of segments between two points on the path (more = smoother)
  • tiled = should the sprite be tiled over the path (0 = no tiling, 1 = tiling)

Script call:

draw_path_sprite(path, x, y, width, sprite, spriteIndex, spriteScaleX, spriteScaleY, color, alpha, segments);

Update 1.0.1:
- spriteRepeatX & spriteRepeatY are now a spriteScaleX & spriteScaleY

Update 1.0.2:
- now works correctly with non closed paths
- segments is now the smoothness between two points

Update 1.0.3:
- added tiled argument

End User Licence Agreement (EULA).

Version 1.0.3. Published April 1, 2015

Created with GameMaker: Studio v1.99.355

Age Rating: 4+

Average Rating

Your review

You can only review assets you've bought.


Gravatar

Stijn D 02 November 2016

Only one complain

This works perfect for me, but some people might not know (like me at first) that you had to mark the sprite to use for 3d (how? open your sprite and click 'used for 3d'). If you dont do this and use tiled sprites it will be all messed up. It's an easy fix but I only figured it out after about 2 months.

I have no further complain because it works perfect and I am very thankfull you made this asset free!! :)


Gravatar

tales d 01 September 2016

a bug on studio 1.4.1567?

it seens to be picking another crazy textures from my game when i choose tiled .
i think this is way too complicated to me to fix, but thank you anyways , it's a very interesting code


Gravatar

Pawel T 16 October 2015

I prepared tiles for roads before, but.. who care!

This is one of must have assets imo and it's free!
AS @Stijn D wrote, sprite should be for 3d and color in script settings just white, it can save some of you time.
Thank's for this script!


Gravatar

Zack B 28 June 2015

Fantastic

Easy to implement and works exactly as expected. Great asset!


Gravatar

Anonymous 31 March 2015

Excelent!

Easy to use :-)

Tips: you should include an option to remove the closed path, eg. by not drawing the last two points.
For those who are looing for a quick fix:

if (i < segments-1) {
draw_vertex_texture_colour(x1, y1, step * spw * repeatX, 0, color, alpha);
draw_vertex_texture_colour(x2, y2, step * spw * repeatX, repeatY, color, alpha);
}

This review was left for a previous version of this asset.


Gravatar

Muhammad R 15 March 2015

Easy and Awesome!

This is simple, and powerful. The only minus thing is this script only works for closed path. Please, update this script, make it work on not closed path. :)

This review was left for a previous version of this asset.

Logo

ticedev (Publisher) 01 April 2015

Thanks, added your request in 1.0.2!


Gravatar

Jamie F 13 March 2015

Great code

Simple and easy to use, i would love to see an option to make it draw the path open ended, so it did not need to be a loop. 5 stars if you add that ability.

This review was left for a previous version of this asset.

Logo

ticedev (Publisher) 01 April 2015

Thanks, added your request in 1.0.2!

Package contents

Total size 2.32 KB

What is the issue?

Back to Top