R0J0hound's Forum Posts

  • SoldjahBoy

    Webgl doesn't get along with my PC so I'm not really working on shaders anymore.

    The shader works by taking the source texture's alpha and making a colored silhouette. Then that is duplicated eight times and each one is moved in a different direction. The first to the right, the second down-right, the third down, and so on...

    To make it outline multiple objects as if they were one object you need to Make them one image first. That's what layers do, so a layer per multi-part object could be one solution?

    You could instead use the paster object. Basically by drawing each group of objects to their own paster instance and applying the outline effect to that.

    I've become rusty with making shaders and since I can't test them I can't come up with ways to change the blend mode or opacity of them. However the outline can be done with the paster object without webgl and the end result is an the paster object will have the outline as a texture so you can draw it any way you'd like.

    I'm not able to make a capx right now but here's how to do it:

    First create a paster object and rename it outline. Make sure it's a little bigger than the object you want to draw and make it's origin centered.

    For simplicity we'll outline a Sprite. The events would look like this:

    Global number linewidth=4

    Every tick

    --- outline: clear to rgba(0,0,0,0)

    --- outline: set quad color to rgba(0,0,0,1)

    Repeat 8 times

    --- outline: set position to Sprite

    --- outline: move linewidth pixels at loopindex*45 degrees

    --- outline: paste Sprite

    Every tick

    --- outline: set position to Sprite

    --- Sprite: set blend mode to destination-out

    --- outline: paste Sprite

    --- Sprite: set blend mode to normal

    --- outline: draw quad (0,0, 640,0, 640,480, 0,480) with blend mode destination-in

    That should do it. The quad color is whatever color you want to use and when the quad is drawn on the paster with the destination-in blend it colors the outline. I was a tad lazy with the corners of the quad, it just needs to cover the outline object so you could use the bbox expressions instead. Anyways barring anything I overlooked that should give you a way to do a outline with the paster object. I'll try to make up a more re-useable example later.

  • Like this?

    key 1 is down

    key 2 is down

    trigger once

    --- play sound

  • 21 isn't a key code for anything. Lookup "javascript keycode" on google to get a list of keycodes for the different key. Like this one:

    http://www.javascripter.net/faq/keycodes.htm

    Numpad 1's key code looks to be 97 if numlock is on.

  • Okay, use this instead:

    str(x)&str(y)

    The "&" operator is both string concentration and logical and. If both values are numbers then logical and is used otherwise string concentration is used.

  • There isn't really a need for an array at all. And really events aren't much different from regular code.

    https://dl.dropboxusercontent.com/u/542 ... cking.capx

  • set z to int(x&y)

  • You can do it without the canvas plugin. The ring is made by creating sprites in a circle. An the masking is done by using blend modes. The shrink/grow of the circles is done by changing the size:

    https://dl.dropboxusercontent.com/u/542 ... _load.capx

  • I tried my hand at making a minimal event ticktacktoe before looking at whiteclaws' example.

    I got 6 (or 4 if you don't count variables) events and I think this is near bare minimum*.

    https://dl.dropboxusercontent.com/u/542 ... event.capx

    You can increase readability by bumping it up to 8 (3 variables and 5 events):

    https://dl.dropboxusercontent.com/u/542 ... dable.capx

    *A one event ticktacktoe is possible by using the conditional (?:) operator:

    https://dl.dropboxusercontent.com/u/542 ... event.capx

    Well it's actually one event and two variables.

  • The blend modes are something that will work even without webgl. So without webgl that's the limit what can be done. Once webgl is supported absolutely everywhere subtractive could just as well be a blend mode I'd imagine.

  • On another note, the configurations panel has been in there since the very earliest versions of C2. The earliest I could check was r23 and it was in there. It may have even been in r0 but I don't have that one in my files.

    Ah, it was added in r9

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I belive he means the configurations bar with this manual entry:

    https://www.scirra.com/manual/50/add-configuration

  • If you look around the install directory of construct classic is a folder called effects. In it is a bunch of fx files that can be opened in a text editor. They are basically direct X hlsl shader programs, so you could google more info about how to write one.

    I forget if there are any posts on how to make your own but you can search the construct classic sub forums. There are a good amount of fx files on the forum too.

    Probably a good start is trying your hand at modifying existing ones.

  • It's basically a leftover for a planned feature that never materialized. It currently does nothing to the best of my knowledge.

  • I can describe how to make an example.

    Create a new project

    Add a second layout

    In the first layout create a Sprite

    In the second layout create a different Sprite.

    Run the first layout. Only the first sprite's texture is loaded.

    Add an event to the first layout that creates the second Sprite at the start of the layout.

    Run the first layout. Now since the second Sprite was created its texture is now loaded too.