Is a crop behaviour possible?

Discussion and feedback on Construct 2

Post » Sat Jan 03, 2015 12:26 pm

Hi, all, especially Behaviour makers - I was wondering if a crop behaviour would be possible, i.e. is it possible to control the very basics of object drawing by kinda shifting the drawing rectangle, like this:

StuffGEN C.png


I have my own use for something like this, but it would certainly be useful for all sorts of loading bars, liquids filling and such.
You do not have the required permissions to view the files attached to this post.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Sat Jan 03, 2015 12:29 pm

It just depends on where the hotspot is.
As far as I know we don't have the ability to change it in the sdk.
Image ImageImage
B
169
S
50
G
173
Posts: 8,321
Reputation: 110,286

Post » Sat Jan 03, 2015 12:38 pm

Hmm, but if we were to assume it's hard-coded to top left?
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Sat Jan 03, 2015 12:51 pm

A good test is: stick a sine behavior on a sprite with movement set to width.
Preview that, then change the hotspot, preview again.
It always grows from the hotspot.
Image ImageImage
B
169
S
50
G
173
Posts: 8,321
Reputation: 110,286

Post » Sat Jan 03, 2015 1:30 pm

I'm sorry newt I might be misunderstanding something, but the base idea - showing just a part of the sprite, but without shaders - is that possible? As a behaviour?

If it comes from the hot spot that might actually be a bonus.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Sat Jan 03, 2015 1:48 pm

I guess technically could be possible (after all, a sprite is showing part of a spritesheet when you think about it), not sure that a behavior would do it however, I think more of an effect or a dedicated plugin for that use, not sure someone did one.

alternatively, the paster plugin could work:you paste a part of the big image.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Sat Jan 03, 2015 1:57 pm

I agree, I'm thinking that Paster will be your friend to achieve this. You could either copy half of the sprite and show it on the Paster object, or you could paste the background onto the Paster object and then hide/reveal the sprite from underneath.
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888

Post » Sat Jan 03, 2015 1:58 pm

You can either change the size of the object and it will change based on where the hotspot is, or use one of the blend modes.
For an occlusion like your first image its a dummy object with either blend mode, or an fx.
Image ImageImage
B
169
S
50
G
173
Posts: 8,321
Reputation: 110,286

Post » Sat Jan 03, 2015 2:23 pm

To make it clearer why I would need to split a sprite into half - it's for this project: https://www.youtube.com/watch?v=GXAO74Q8ccA - would enable having way more variety in the parts.

As we can see the parts are rather overlaid, would a blend mode help to hide just half of the active sprite? I suspect not really... but then I'm no pro at blend modes.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Sat Jan 03, 2015 6:15 pm

I was thinking, from a plugin standpoint, you might be able to do that if you were able to change where the hotspot was.
Im pretty sure we can't access that in the sdk.

On the other hand: viewtopic.php?t=90520&start=0
Image ImageImage
B
169
S
50
G
173
Posts: 8,321
Reputation: 110,286

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests