R0J0hound's Recent Forum Activity

  • Glwrap isn't the area to look in. It's just helper functions and functions to draw batches of images. As I recall the area to look in is preview.js. The layout class has two functions draw() and drawgl(), that's the lowest point where the drawing takes place. Before those are called I think there's some init code that sets up the canvas size and some variables for scale.

    My thought is if you use the unscaled canvas mode you can then take that image and draw that to a full screen canvas. I'm unconvinced it will be faster in the case of canvas2d especially with the need of another canvas. Also unless point sampling is available it will look blurry in canvas2d.

    For the case of using webgl you could try the same method but It may run into performance issues like my canvas plugin has with webgl. But that's just what I've gathered in the process of making my paster plugin.

    Anyway happy hacking. You'll no doubt Learn a lot about what makes c2 tick.

  • I can't open the capx because I'm on my phone, but are you using the bullet behavior?

    If you are the save the angle of motion of the cars to an instance variable before you stop it and set it again from the variable when you start it.

    I think a search for "bullet behavior" and "moving right" may lead to the topics on why this happens.

  • Right now you can only draw quads with the one texture. Having to load a different texture is not ideal as it can be slow. I'll probably depreciate that and instead look into just using the texture of a picked sprite.

  • winsonzhong

    Is it slow or just not work? I'll check it out but there's no reason it should work any different than the browser.

  • Version 0.3:

    [Added] imageUrl expression. newt

    [Added] load image.

    [Added] Textured quad drawing.

    --- A separate image can be loaded and then drawn distort map style. Works in both webgl and canvas2d.

    Example capx:

    https://www.dropbox.com/s/3npp82ga2z1fv ... .capx?dl=1

    /examples19/paster_distort.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • gamepopper

    Erasing is done by pasting objects with the "destination out" blend.

    You could use a second canvas with the "destination out" blend and draw to that then paste it to the first canvas.

    xDGameStudios

    The paster does this with quads. I'll have to have to consider a way to cleanly add it to the ACEs for this plugin. In the mean time you could try the methods above.

  • Looking at the js files it doesn't appear to use a framebuffer. Webgl just scales better than canvas2d when drawing a larger scale.

  • 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!

  • 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.