R0J0hound's Forum Posts

  • clrammer

    I just reviewed your comment and there was an issue with the "clear with color" action but it should be corrected in version 0.2.

  • AnD4D

    To fix the color make the "color" paster invisible and the "mix" paster visible. The RES stuff is working fine for me... try setting the resolution to something low like 100x100 to see the effect more readily? With linear sampling it can be very subtle at times.

    As for speed the new method is certainly faster with webgl on. With webgl off it's slower but that's only because it uses 4 canvases instead of 2.

    xDGameStudios

    That method of shadows is basically what my latest examples do. The paster and canvas plugins support pasting objects with "destination out". The paster object also already allows you draw a quad with your blend of choice.

  • Change the sprite's blend mode to additive and make sure it's black under them. You can then get any color.

  • I fiddled around with the composition some more and put it in one of my older examples to test it out with scrolling.

    https://dl.dropboxusercontent.com/u/5426011/examples19/mario_record_w_shadows.capx

    Ashley Kudos! Copy/pasting between capx' and the replace object function work great!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The function is the same in Paster as it was in canvas. The issue here at least for me is the texture size is bigger than the max supported size of my video card. Also at least for this example you only need to cover the window not the entire layout.

    eg.https://dl.dropboxusercontent.com/u/5426011/examples19/NewLight.capx

    If you scroll just reposition the canvas accordingly.

  • Updated to version 0.2

    This update adds more hotspot positions than just "center" and it adds the ability to draw colored quads with a blend mode of choice.

  • With vanilla C2:

    1. Select the bottom layer and set transparent to true.

    2.Goto "Project Properties" and set "Clear Background" to "No".

    3? If "Enable WebGL" is "on" add the brightness effect to the layout.

    There you go, no clearing between frames.

    For more control you could try out the canvas or paster plugins. Both work well when webgl is off, Paster is much faster with webgl on.

    https://www.scirra.com/forum/plugin-canvas_topic46006.html

    https://www.scirra.com/forum/plugin-paster_topic75668.html

  • Because the pasters are just created they can't be picked from a family until the next toplevel event. A solution is to add a second "start of layout" event and move the "set resolution" action to that, or you could discard the family completely and do a "set resolution" for each paster type.

  • RES isn't used, I forgot to remove it. If you want to use it just change set resolution int the start of layout to 640/RES,480/RES. It isn't used elsewhere.

  • Hi,

    I converted the example to use the Paster plugin instead of the Canvas plugin so it will be much faster with webgl.

    This is the result of much tinkering and unfortunately even I have a hard time to see what I did. Basically the lighting is done with transparency and then the color is a separate canvas below so I can have finer control of the blending.

    https://dl.dropboxusercontent.com/u/5426011/examples19/shadow_cast_paster.capx

    Here is a simplified version that just has one light.

    https://dl.dropboxusercontent.com/u/5426011/examples19/shadow_cast_paster_simple.capx

  • Doesn't "wait 0 seconds" already wait 1 tick?

    From the manual:

    ne more trick: "Wait 0 seconds" postpones the following actions until the end of the event sheet.

  • Hi, I had a quick look at the capx. I also tinkered abit with making objects visible but my implementation of my idea wasn't working right. As to multiple canvas' it's for the additive blending of the lights. Each light casts shadows on its own canvas and then it's additively drawn to the main canvas for blending. I got away with just two canvas' since I can just keep reusing the 2nd canvas for each light. The composition will have to be reworked to incorporate transparency so you can allow textures underneath to show through.

    Here's a rough idea how it could be done.

    I think it's "destination out" that acts as an erase.

    1 draw shadows to canvas c1

    2 fill canvas c2 with the light color

    3 give c1 the destination out blend and paste it to c2.

    C2 will then have the lit areas colored and the shadow areas transparent.

    4 paste the falloff sprite to that too and then paste it with an additive blend to canvas c3

    Do that go each light.

    5 you can then get the shadows again with steps like 2 and 3. The shadows should be now on canvas c4.

    The only 2 canvas that should be drawn are c3 for the light and c4 for the shadows.

    You could then fiddle with the light canvas opacity to adjust the blend.

    There may be some issues with the idea since I haven't tested it.

  • Sorry, I don't login too much and I miss many posts.

    For the first Q you're talking about an object casting shadow and being visible when lit, right? One idea that comes to mind would be to only cast edges facing away from a source. Although it wouldn't work great for concave objects.

    For a texture underneath you could reduce the opacity of the gradient sprites. I don't entirely recall what the example does so I'd have to tinker with it. Another idea would be to reduce the opacity of the color fill.

  • I'd just use the uid instead of iid and uid. Here's a way to rework event 190 to stop creation of duplicates. The else is run only when there are no arrows paired with a pickup.

    +circleBounds: on collision with BoxPickups

    +For each BoxPickups

    ---+ArrGd: ThnUd = BoxPickups.uid

    ------ //nothing

    ---+Else

    ------- //your creation actions

  • Hello,

    For this:

    for(i=0;i<10;i++)

    {

    printf(i);

    }

    The equivalent in C2 would be this:

    for "" from 0 to 9    

    ----Textbox set text to loopindex

    Or if you want a named loop variable:

    for "i" from 0 to 9    

    ----Textbox set text to loopindex("i")

    Lastly your initial event setup in your first post would look like this in c:

    int i;

    for(int loopindex=i; loopindex<=10; ++loopindex)

    {

    ++i;

    break;

    }

    -cheers