[Plugin] Custom Draw

Post your work in progress addons and get feedback

Post » Tue Apr 04, 2017 7:01 pm

Custom Draw Plugin
Download:
https://www.dropbox.com/s/lm5b6l4mhr3vy ... 0.zip?dl=0

Features:
* This plugin allows you to use any sprite's texture to draw quads or points.
* They can be transformed with translation, rotation, scale and shear.
* It has a transformation stack to do nested transformations.
* There's an expression to transform any x,y value with the current transformation.
* The uv's of the texture can be specified. Some actions are included to make selecting a sub-texture easier.

Use notes:
* This is a webgl only plugin. A canvas fallback hasn't been implemented at this time.
* The drawing is relative to the object's center and the object's size and angle aren't automatically used.
* The drawing can be bigger than the object's bounding box, but the bounding box is used to determine if it should be drawn.

Example:
https://www.dropbox.com/s/n78c9dywrulcz ... .capx?dl=0
https://www.dropbox.com/s/0b08fcy5ienxb ... .capx?dl=0
https://www.dropbox.com/s/w5hmjdohlyher ... .capx?dl=0
Last edited by R0J0hound on Thu Apr 06, 2017 6:22 pm, edited 2 times in total.
B
92
S
32
G
110
Posts: 5,295
Reputation: 71,501

Post » Wed Apr 05, 2017 3:33 pm

@R0J0hound

Good plugin, thank you very much ...
B
62
S
22
G
29
Posts: 822
Reputation: 22,332

Post » Wed Apr 05, 2017 5:03 pm

Thank you brilliant plugin
Image
B
25
S
14
G
12
Posts: 291
Reputation: 9,404

Post » Wed Apr 05, 2017 5:18 pm

Crikey that looks interesting.

Many thanks, R0J0hound.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,420
Reputation: 59,526

Post » Thu Apr 06, 2017 6:39 pm

Added two more examples/experiments.

Also as a "mini tutorial", this is all you need to do to draw something:
1. Load a texture from a sprite. This can be done as often as you'd like. Despite saying "load" this is instant.

2. Add four vertexes or use the "add rectangle" action. The "add rectangle" and "add vertex XY" actions will set the UV coordinates of the vertexes automatically. Use the "add vertex XYUV" action to manually set the UVs.

3. Use draw action to draw quads. It will draw a quad for every four vertices.
B
92
S
32
G
110
Posts: 5,295
Reputation: 71,501

Post » Thu Apr 06, 2017 8:41 pm

@R0J0hound

This one is awesome ... also the rest too... thx you.
"3. Use draw action to draw quads. It will draw a quad for every four vertices. "
B
62
S
22
G
29
Posts: 822
Reputation: 22,332

Post » Wed Apr 12, 2017 3:11 am

Interesing plugin, I wonder it's possible to make an animated waving flag
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Wed Apr 12, 2017 6:14 am

Sure. its probably done the same way as just moving sprites in a waving motion.
B
92
S
32
G
110
Posts: 5,295
Reputation: 71,501

Post » Tue Apr 18, 2017 3:36 pm

Once again you completely amazing me R0j0hound.

Are the objects drawn interactable?

For instance in your circular tilemap example, can each tile be clicked on or adjusted seperately?

Thanks
B
87
S
44
G
16
Posts: 1,005
Reputation: 17,938

Post » Tue Apr 18, 2017 4:29 pm

@justifun
I don't have any plans to make it interactive, that would have to be done with events.
B
92
S
32
G
110
Posts: 5,295
Reputation: 71,501

Next

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 4 guests