armed10's Forum Posts

  • There isn't a way to make html/css tables in construct 2 yet. Otherwise you could just design one here: http://www.csstablegenerator.com/

    To answer your question: you can probably make a function that takes an array as data (2 dimensional) and create a tiled background or a 9-slice with text in it for all entries.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well I don't think a master Z layer exists, it seems to me that your problem can be fixed by using a move to layer

    Assuming the number of layers is the same for all layouts.

    If you want to have a different number of layers on some layouts, you should have a global variable with the number of layers and set it at the start of a layout.

    If this doesn't solve your problem, maybe you should reconsider your layers.

  • jayderyu

    I agree with you, but I fear this would kill the dynamic properties of function, such as project wide referencing without including an event sheet. There has to be some middle ground though.

  • +1

    I would love this too. For now I'm stuck creating global variables with the same name so they show up in intellisense

    That's not a bad workaround, thanks for the tip.

  • One of the things I love the most about Construct 2 is the function object. It allows me to define my own functions and call them from any sheet. I use the function object more than any other object in construct. On top of that it allows me to work more OO keeping responsibilities where they belong.

    There is only 1 downside to the function object: if you make a spelling mistake, nothing will happen and the game doesn't give you an error.

    Having Auto-complete in function would be perfect to solve this issue, as well as stimulate a more structured event sheet. Right now I use "object.functionName" on many event sheets and having auto-complete after I type an object with all the functions matching that name would really make my day.

  • Problem Description

    The textbox describing what to do when creating an event to set the opacity of an object is wrong.

    Attach a Capx

    https://www.dropbox.com/s/3t6il3n6dweb2 ... .48.26.png

    Description of Capx

    I don't think it needs a capx to describe the problem since its a minor visual bug. Nothing is broken under the hood.

    Steps to Reproduce Bug

    • Create object
    • Create event -> set opacity

    Observed Result

    wrong descriptive text. it says: How to compare the X-coordinate

    Expected Result

    Something about opacity.

    Affected Browsers

    In-construct itself.

    Operating System and Service Pack

    Win7 N all updates

    Construct 2 Version ID

    r167

  • Sorry I misused the term instance, I mean an object has the same method name as another. Both included in one layout would give problems.

  • Hi!

    I was just wandering if there are any serious repercussions to duplicating the function plugin and removing the "flags": pf_singleglobal.

    This would allow me to work a little more Object Oriented as well as use duplicate method names (I hope?). For instance have 2 NPCs with a shoot() function that is specifically their own.

  • 2D lighting in webgl would be awesome! I'll follow your progress closely :)

    Thank you, I will keep this thread updated. I also have a rather elaborate prototype due in the next 2 weeks, so I won't be updating this soon.

    The current system works IF you use separate layers for the lights (because of the source-out drawing). The performance of canvas2D rendering this way instead of clip() makes for less performance, though I tested about 6 lights and it worked fine. There is some drop in frame-rate.

    Node-webkit export does have major performance issues with this method.

    My best option is to implement a WebGL version, since this would increase performance and will probably have more efficient image manipulation tools available.

    If interested I will post the Canvas2D version with a tutorial on how to use it, for testing purposes.

  • Thanks for the reply!

    although using restore seems to cut performance to an unworkable level, even when using only 2 sprites, the blending options might be just what i need.

  • No I haven't, I'll do that right now.

    EDIT: I don't see how this helps, but I should be able to replicate my code in webgl which may allow me to do this per image instead of canvas wide.

  • Do you have a code snippet to show? Hard to offer suggestions without it. Except that you need to restrict clipping to the current light sprite obviously.

    This is exactly what I want to do.

    Right now I draw a path in with the canvas context element, then simply clip();

    //for each object type

    for (i = 0, leni = this.type.obstacleTypes.length; i < leni; i++)

    {

        //for each instance

        instances = this.type.obstacleTypes.instances;

        for (j = 0, lenj = instances.length; j < lenj; j++)

        {

         rinst = instances[j];

         //if overlapping

         if (runtime.testOverlap(this, rinst)){

    //have to draw the path around the object first (set it to the viewsize, because if they overlap, it basicly cuts every light according to 1)

                ctx.beginPath();

                ctx.lineTo(0, 0);

                ctx.lineTo(0, myy + runtime.height + this.height);

                ctx.lineTo(myx + runtime.width + this.width, myy + runtime.height + this.height);

                ctx.lineTo(myx + runtime.width + this.width, 0);

                ctx.lineTo(0,0);

    //Draw a path that needs to be cut out of the image

    //this part has a lot of conditional lineTo(); which is omitted

                ctx.moveTo(endpoint.x, endpoint.y);

                ctx.lineTo(imgp1X, imgp1Y);

                ctx.lineTo(imgp0X, imgp0Y);

                ctx.lineTo(endpoint.x, endpoint.y);

                                                        

                ctx.closePath();

                ctx.clip();

    // after this it draws the image

                                            }

                        }

                  ?}              

    You cannot implement a lighting system by clipping for this exact reason. You need to render each light separately with additive blending.

    How would I go about doing this? is there a way to manipulate the cur_image, or even in webgl?

    I would like to be able to specify a region that will not be rendered.

  • Hey there!

    I am currently developing a 2D lighting system in javascript for canvas2D.

    The goal is to create an identical thing for webgl as soon as it properly works.

    I've gotten as far as to have a light working perfectly, except when adding more than 1 light gives a problem.

    The system works by drawing a sprite (yes I copied the Sprite plugin, it was the fastest way) and clipping away where shadow should be.

    but when using more than 1 light, the cliping path subtracts when overlapping

    Works Fine:

    <img src="http://s17.postimg.org/cyqxmq1rj/works_fine.png" border="0" />

    Subtracting paths:

    <img src="http://s13.postimg.org/4zx3hs15j/problem.png" border="0" />

  • Wouldn't it be ideal to inherit from the official plugins?

    Don't know how this is handled in javascript though.

  • Platform template in construct 2 as source

    Steps to reproduce:

    1. walk up slope

    2. press jump

    Observed result:

    character doesn't jump

    Expected result:

    jump

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    Windows 7 SP1

    Construct 2 version:

    r120