How do I use effects and masks to do this?

Get help using Construct 2

Post » Tue May 27, 2014 8:33 pm

Hello everyone, I'm trying to create (at random) monochrome backgrounds using simple overlapping shapes like this:
Image

As you can see in this example I made, I'd like to:
- pick 1 random color (that I do by creating a 1x1 red pixel with the "Adjust Hue effect" that randomly generates hue, saturation and luminosity)
- decide if this color is foreground or background (with the "choose()" expression)
- Apply the color to the background or foreground (I think it's done by choosing the right blending effect on the right layer?)

- And (the most important part) make it so that when two sprites overlap (for the binary suns in the picture above), the color of the intersection is the background color.

Please, please help me, I'd love to create those backgrounds at random and add animation to it. I feel I'm close but I can't seem to grasp how masks and effects work together with layouts, backgrounds and overlapping sprites. And believe me, I read the "effects" section of the manual.
B
3
Posts: 13
Reputation: 303

Post » Tue May 27, 2014 9:40 pm

I would also like to know!
B
24
S
4
G
1
Posts: 174
Reputation: 1,821

Post » Tue May 27, 2014 11:47 pm

I think you will need the canvas plugin for this. even if not, I am pretty sure it will come handy, so advice checking it.
B
17
S
4
G
1
Posts: 332
Reputation: 3,099

Post » Wed May 28, 2014 10:12 am

Do I really have to use a plugin ? I'd like to avoid plugins otherwise I won't learn a thing...
B
3
Posts: 13
Reputation: 303

Post » Wed May 28, 2014 10:42 am

The canvas plugin isn't a shortcut with no learning, it's roughly the same as using canvas in html5 :).

Allows some really nice possibilites.
Image Hats off to me too !
Steam user
B
12
S
2
G
1
Posts: 29
Reputation: 933

Post » Wed May 28, 2014 11:19 am

And where can I find this plugin ? It's not listed in the Plugin Reference (in the Construct2 Manual)
B
3
Posts: 13
Reputation: 303

Post » Wed May 28, 2014 11:48 am

B
44
S
10
G
8
Posts: 437
Reputation: 6,463

Post » Wed May 28, 2014 11:56 am

OK, thanks for the link, I thought plugins were stored in the scirra store and found nothing :?

I read the plugin description: this doesn't really answer to my questions...
Last night I managed to create more or less what I wanted: random generation of mountains, suns, with a background color that changes (as I described in my first post), can swap between foreground and background.
The only thing that is missing is this: when two black sprites are overlapping, I want the overlap to be white (black is the color I then replace with any color I want).
I thought I could do that by putting sprite 1 on a layer and Sprite 2 on another layer, and use the "exclusion" or "difference" effect, but it won't work (or I'm doing it wrong).
That's really the last thing that's missing, and I feel installing the Canvas plugin won't necessarily solve this problem (and will make a lot of what I made until now obsolete).

I'll post the .capx when I get back home tonight to show you what I mean.
B
3
Posts: 13
Reputation: 303

Post » Wed May 28, 2014 12:28 pm

May I play Devil's Advocate for a moment.......
I know you said you read the manual, but Ashley specifically states in the effects section not to use effects on static images or sprites as it has a performance degrading effect. Are you sure this is the best way to achieve what you want? What readings are you getting from debug? What platform(s) are you targeting?
If your vision so exceeds your ability, then look to something closer.
Moderator
B
131
S
29
G
81
Posts: 5,328
Reputation: 56,630

Post » Wed May 28, 2014 1:08 pm

I'm not targeting any platform, this isn't even a game yet. But the overall aspect of it will be very light. No GUI, just backgrounds and text (and a few sprites as comic book cells, if you see what I mean).
Construct 2, with HTML5, is to me far more than just a game making tool. I'm thinking about my project more like an interactive comic book than a game. You know, something a little bit like The Yawhg. This means that the core of the mechanics are just branches, options in the narrative, nothing really complex to compute.

Let's just say I wan't to make something more pretty than interactive.

Do you think I'll still experience performance issues ? I'll post what I've been able to make yesterday in a few hours, I haven't opened the debug window yet (it's wrong, I know).
B
3
Posts: 13
Reputation: 303

Next

Return to How do I....?

Who is online

Users browsing this forum: adamebastin, ketramtu18 and 8 guests