R0J0hound's Forum Posts

  • If you name your layouts like this:

    level 1

    level 2

    level 3

    ...

    You could use the action "Goto layout (by name)" with these two expressions to go next/previous:

    for Next Layout:

    "level "& int(mid(LayoutName, 6, 3))+1

    for Previous Layout:

    "level "& int(mid(LayoutName, 6, 3))-1
  • To add to the report:

    The glitch only occurs if it's resized.

    Steps to reproduce:

    1. In the image editor resize the color picker. At this point it all looks fine with the controls positioned correctly.

    2. Close the color dialog and then re-open it. Stuff is now positioned wrong.

    zendorf

    For now you can use "preferences"->"reset dialogs" put the dialog back to it's original size.

  • Re-download the plugin, I made a fix for r147.

    I did like the color blending in the canvas version, but I used a slightly different approach in the paster version so backgrounds wouldn't be as washed out. It could use improvement though.

  • Ok, fixed the issue that came up with r147. Re-download from first post.

  • I haven't updated to r147 yet, so I rolled back the version in your capx and it's working fine here. What was the error message?

  • You could use the ctx.save() before clipping and ctx.restore() after clipping to reset the clipping region. I may be a problem when making the webgl version as webgl doesn't appear to have an equivalent to clip().

    Another way to go about it is drawing to a canvas and using a blend to combine the images in various ways.

    Look here:http://www.w3schools.com/tags/canvas_globalcompositeoperation.asp

    The idea can easily be used with webgl as well.

  • Eh, you'll end up having to rewrite to much if you go that route...

    Webgl already draws to a texture so as a start you can modify the drawgl function on line 475 in layout.js.

    As a quick ugly hack I changed line 477 to

    var render_to_texture = true;//(this.active_effect_types.length > 0 || this.runtime.uses_background_blending);
    this.runtime.width=100;
    this.runtime.height=100;

    That makes it draw to a low res texture.

    Then to stretch it back big to cover the canvas I inserted these two lines at line 509:

    this.runtime.width=this.runtime.canvas.width;
    this.runtime.height=this.runtime.canvas.height;

    It made it all pixely but visibility clipping was off so unless the objects were in the 100x100 pixel area in the middle they became invisible. You'll have to delve deeper to I think the layer drawgl function and tweak the visibility check there. Also this completely disregards any aspect ratios.

    For completeness you'd want to edit the canvas2d draw function as well, but that's a different beast.

    Unless point sampling can reliably be used across all canvas2d implementations I can see why it wouldn't be included in c2 because it would the image would be filtered when resized, which i'm sure will result in many posters asking why their game is blurry. But that's just my 2c.

  • 0.4 Update:

    Now textured quad drawing will use the texture of a picked object.

    (Works with sprite,tiledbg,canvas,paster and particles)

    winsonzhong

    NodeWebKit seems to be working fine for me... Maybe it's some kind of driver issue.

    newt

    eah I noticed it has some issues with loading cross domain images, and drawing past the bounding box threw an error.

    It can load any image that you can with the sprite plugin which has the same cross domain limitation. It's an html5 limitation. Also can you post a capx that throws the error.

    oincidentally the draw seems to draw to the resolution rather than by pixel. Like draw x2 4 y2 4 filled the 16x16 object.

    The point locations are layout locations instead of being relative to the object as it was in the canvas plugin. Drawing should be mapped correctly regardless of the size or resolution of the canvas.

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

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