Somebody's Forum Posts

  • Setting all sprites origins to top left didn't change anything btw.

    I had to set the grid to 20x20. Hope this doesnt interfere with my grid based movement or anything.

    No offence, but you must be doing something wrong then:

  • Your grid starts at 0,0, your origin point is in the middle of the object, thus 20px off-grid. Either move the origin point to a corner or use a 20x20 grid.

  • I have ran into this as well - seems like the solution is to make your own loop - i.e. a variable you add to and then just do something like Variable < TargetSize do events, wait...

  • Somebody, I agree with kamizoto on the duration statement. It shouldn't be uber hard to add another extra parameter where we can input a time measure - a simple "screenshake every X seconds" parameter.

    Currently I'm using a Function for this since I kinda despise variables =P http://i.imgur.com/vIKICqQ.png

    I'm no programmer so my logic sucks, but if you add that 3rd parameter, I can get rid of the Function "object".

    Well, as mentioned above Shaders don't remember variables and such - most that could be done would be making a separate shaking Shader with just one parameter - strength.

  • Somebody

    For the drop shadow effect it would be great if we could set the layers it would cast onto, an which not.

    I aplied it to my game and it worked great, except that some shadows unwanted where casted on the "sky' background layer aswell.

    As previously mentioned Shaders are quite "dumb" so I doubt this is possible. I see how it could be useful, though, but unfortunately cannot help...

    Oh, and a "extra" zip with all the addons in it would be great.

    Then we can just update the whole bunch each time in one drag & drop.

    I like them all, so i want them all, in one go

    The dropbox folder doesn't offer this option? Will have to look into it, as I only see it as the maker.

    ! This is amazing Somebody ! The drop shadow effect was a request for so long now and you nailed it a day after Helena mentioned it! And it works on the Text Object too!!! :O

    Well, it's mostly lucky timing as I just now understood how reading the pixel data from offset pixels works in a Shader

    May I ask if it's possible to see the shadow on the layout? Because it's only visible at run-time.

    I suspect the editor doesn't have "real" transparent layers, so it cannot tell apart what is and what isn't a separate object on a layer... Thus it doesn't cast any shadows. I'll have a look into it, but probably not possible.

    And another thing, is it possible to have an invert Y option, you know, in order to cast shadows on the floor bellow the feet of a character like he/she is being lit from behind..?

    Here we return to Shaders being "dumb" - the best we could do for something like this would be a "mirrored" shadow, but it would be locked to a certain breaking point and not a "per object" shadow. Like this:

    So I think it's a better idea to go with objects for a shadow like that.

    Anyway, thank you so much for your effort, you are really spoiling me!

    Thanks. It won't go forever, though, at some point the ideas will run dry. But for now there are a couple more incoming.

    I like your shadow implementation.

    I made this one for myself few months ago, but since then i could not figure out a way to handle shadow scaling, so I never published it.

    But there's a one thing that may interest you for your drop shadow future updates - colored shadows

    (fx may be a bit messy, cause it is and probably alway be work in progress)

    Thanks! Will check it out - I prefer few parameters and fewer actions inside the Shader to keep them efficient, but perhaps a separate version could make sense.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Twisty fishes! The twist effect make me think of fishes swimming.

    I have added wish of dropshadow effect to the general wishlist of effects. Transparent or not, crisp or blurred. the kind of dropshadow that is hovering behind with equal size, 3 pixel bottom-right (of course distance and direction could be changed). Respecting the alpha of the main object. Maybe you can figure out something? Of course, I am just writing here "thinking out loud" not demanding anything. I look forward to more updates in this, no matter what.

    Like this?

    Making it blurry would be too resource-hungry, but it has offset and opacity settings. Best used on a transparent layer. The result is slightly weird with a transparent object, but I might overcome that on a future version (still learning).

    Added to repo and first post.

  • I think you should look into using webstorage (instead of making the browser download it). That would take care of seamless saving. In my case I needed a tangible file so this approach was used.

  • These are incredible Somebody will find these very useful! I'm wondering if it's possible to use these to create a true mario style screen wrap, you know, where mario leaves the screen edge, and wraps around the other side, but you can leave him halfway, so that his front is on one side and his backside is on the other?

    I guess you could, but it would be a purely visual effect. For a game it would make more sense to just duplicate a Mario that is close to an edge.

  • From the description that sounds quite doable, but the video link is not the right one

  • Here's an additional demonstration - could it be that either the pixelWidth and pixelHeight values are acting weird or something is equally weird with alpha when a sprite is moved?

    In theory the sprite gets moved exactly a given amount of pixels - 128 or 64 or so. As we see the effect acts different when a sprite is moved somewhere and then comes back. Any idea why that is?

    I would do further research, but since there's no way to debug a Shader I have to ask here...

    Edit: More info:

    The strangeness happens if there is any other Shader present - it seems as if having a different Shader in the stack also "adds" some extra space around the sprite, even without the expand properties being used - here's the "inline" with a Shader in the stack: http://i.imgur.com/XVNqScz.png - it seems like it is able to "detect" the surrounding pixels and properly mark the inside of the sprite since there's 0 alpha around.

    And without any other Shader it looks like this - http://i.imgur.com/LXMbyP5.png - nothing is drawn since, apparently, the Shader cannot read the 0 alpha from outside of the sprite bounds.

  • R0J0hound This looks really neat. Is there a way to export the canvas to a sprite so that I can save the sprite as a base 64 string?

    Perhaps look at the paster plugin - I saw your other question - it's as easy as pasting your parts onto a paster object and either using that as the sprite right away or using a regular sprite with load image from url from the Paster object.

  • But I need to keep the same Alpha as the original image - only change the colours. If I multiply with the calculated alpha then everything gets filled, which isn't desired:

    Besides if the sprite is moved the same artefacts appear:

  • All right, after doing some research (basically reading some other posts here) it looks like I managed to make a working version:

    /////////////////////////////////////////////////////////
    // Selection inline effect
    //
    varying lowp vec2 vTex;
    uniform lowp sampler2D samplerFront;
    
    precision lowp float;
    uniform lowp float pixelWidth;
    uniform lowp float pixelHeight;
    uniform lowp float width;
    
    void main(void)
    {
    	lowp float Alpha = texture2D(samplerFront, vTex).a;
    	
        lowp float A = 1.0 - texture2D(samplerFront, vTex + vec2(0.0, pixelHeight*width)).a;
    	lowp float B = 1.0 - texture2D(samplerFront, vTex + vec2(0.0, -pixelHeight*width)).a;
    	lowp float C = 1.0 - texture2D(samplerFront, vTex + vec2(pixelWidth*width, 0.0)).a;
    	lowp float D = 1.0 - texture2D(samplerFront, vTex + vec2(-pixelWidth*width, 0.0)).a;
    	
        lowp float M = clamp(A+B+C+D,0.0,1.0);
        
    	gl_FragColor = vec4(vec3(M,M,M)*Alpha,Alpha);
    }[/code:2iehbb73]
    
    Initially it works just as expected:
    [img="http://i.imgur.com/dd3M4bs.png"]
    
    But should the sprite be moved strange artefacts appear:
    [img="http://i.imgur.com/bicSiUQ.png"]
    
    And if it's rotated forward and back the artefacts get even worse:
    [img="http://i.imgur.com/Rs4NluD.png"]
    
    I tried changing all the precision settings, but it didn't help. Perhaps someone can explain why this is happening? Perhaps that someone could be @Ashley (I realise you are very busy, but I really would like to understand the Shader behaviour). I'm attaching the Shader itself for easier testing if necessary.
  • I managed to work around it by making (or rather borrowing and adapting) my own Hsb shader (in signature).

  • Sounds like a job for shaders. My scale effect is based on the bottom left at the moment, but could be modified to center vertically.

    But if you aim for a mobile platform then shaders aren't reliable.

    Can you share a video of the effect in action in Castle of illusion?