el3um4s's Forum Posts

  • Ashley With C3 Runtime I have this error:

    Error executing JavaScript: TypeError: Cannot read property 'getProjectFileUrl' of undefined

    This is my code:

    var nameScript= 'mathjs.js';
    var realUrl = this.runtime.getProjectFileUrl(nameScript);
    var jsFile = document.createElement('script');
    jsFile.src = realUrl;
    document.head.appendChild(jsFile);
    
  • I tried to create an autoupdate for an app built with C3 and electronjs. When I release a new version of my app, a warning appears and is automatically installed in place of the old version.

    I followed this guide. On windows it works, on linux there are some problems.

    link to image

    (I have no idea how to implement the same thing with nwjs)

  • Very nice, especially multiple shades / colors.

    Thank you

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just for joke: I made a real time editor with preview for Markdown in Construct3.

    It's simply copy the formatted text into a sprite: I think it can be improved, but I like that you can do something like that.

  • Great plugin!

    Thank you

  • Bubbly Background

    Beautiful bubbly backgrounds for Construct 3 project

    Link to Official website

    Download: C3Addon - Demo C3P

    This plugin allows to change the predifined background with a fancy bubbly one. It’s useful to avoid the black bars when the app doesn’t fit the screen.

    The original idea is by @tipsy and his bubbly-bg repository.

    DEMO GIF

  • Just for joke: I added a bubbly background to Construct3 KiwiStory ??

    update : I almost finished my plugin for set a bubbly background to Construct3.

    This is a test with Scirra's Glokar game:

  • Nice nice nice!

    Thank you

    Another add on my own plugin for drawing map with Construct3: now you can choose the style with a simple event.

  • I do not know if it's the right section, but I have a curiosity.

    I tried to create an executable file with NW.js and with Electronjs. Both for Windows 64bit. I used KiwiStory as a starting point, without modifying anything (I just added a ico file). I setted to true the option Deduplicate images, Recompress images and Minify script.

    For NW.js I used this tutorial. For Electronjs I used this instructions to download a zip files with the HTML and JS source. Then I created an electron app that reference to index.html like start page. This is a github with my code.

    And this is the two files I obtained (hosted on GitHub)

    As you can see, the NWjs export is 77MB (compressed), the Electronjs export is 47MB. If I decompress the NWjs's file I get a folder of 154MB. Electronjs is 3 times smaller than NWJS.

    Instead the used RAM is similar:

    So, why is the size difference so big?

    Another question, from a noob.

    Many applications have been built with electronjs. I myself use some of these (Gitkraken and Atom and Skype). Why does Scirra / Construct prefer NWJS? Are there any features that are missing at Electron?

    One last question: using electron to create a file to distribute is allowed by the terms of use of Costruct3? (Obviously with an active subscription)

  • To simplify my program I decided to create a plugin to view the maps. it's still work in progress.

    gif: https://twitter.com/twitter/statuses/995078682636095488

  • Colludium - Ashley

    I have a problem to set colors in WebGL. I can draw with primary colors but not with other RGBA colors.

    For exemple, if I want to draw a yellow quad, this works:

    instance.js

    iRenderer.SetColorRgba(127,254,212, 1);
    iRenderer.SetColorFillMode();
    iRenderer.ConvexPoly([myx, myy, myx+w, myy, myx+w, myy+h, myx, myy+h]);
    [/code:jfq526sl]
    
    [b]runtime.js[/b]
    [code:jfq526sl]
    instanceProto.drawGL = function(glw) {
        var myx = this.x;
        var myy = this.y;
        var w = this.width;
        var h = this.height;
       glw.setColorFillMode(255, 255, 0, 1);
       glw.quad(myx, myy, myx+w, myy, myx+w, myy+h, myx, myy+h);
      };
    [/code:jfq526sl]
    
    But if I change 
    
    [b]instance.js[/b] iRenderer.SetColorRgba(127, 254, 212, 1);
    [b]runtime.js[/b] glw.setColorFillMode(127, 254, 212, 1);
    
    I have a white quad.
    
    Instead in [b]instanceProto.draw[/b] I can draw a coloured quad simply changing [i]ctx.fillStyle[/i]
    
    [code:jfq526sl]
      // ctx.fillStyle = `rgba(255, 255, 0, 1)`;
      ctx.fillStyle = `rgba(127, 254, 212, 1)`;
      ctx.beginPath();
      ctx.moveTo(myx, myy);
      ctx.lineTo(myx+w, myy);
      ctx.lineTo(myx+w, myy+h);
      ctx.lineTo(myx, myy+h);
      ctx.closePath();
      ctx.fill();
     [/code:jfq526sl]
    
    What's wrong with what I'm doing?
  • Could you give me examples of where to use this for?

    Hello mumu64

    It's only a test of c3's potential. I made it for testing addons in developer mode. If you look into the SDK Manual (this page), I want to simplify the point 2.

    You can use this program also for create a local web server for testing web app built with another software. Some things need to run into a HTTPS server: with this app you can create one and use it for testing.

    If you prefer, you can do the same with command line and npm.

  • Why rotated sprite looks worse using "WebGL enabled" than with no WebGL?

    I created a sprite with only a color and then I rotated it. If i use "WebGL enabled" the outline is pixelated.

    But if i disable WebGL the outline is ... clear.

    I have the same effect if I use GLWrap_ to draw a rectangle:

    glw.quad(tlx, tly, trx, try_, brx, bry, blx, bly);[/code:3b4qfwz6]
    
    the image (after rotation) is worse than
    [code:3b4qfwz6]
          ctx.beginPath();
          ctx.moveTo(tlx, tly);
          ctx.lineTo(trx, try_);
          ctx.lineTo(brx, bry);
          ctx.lineTo(blx, bly);
          ctx.closePath()
          ctx.fill();[/code:3b4qfwz6]
  • The function glw.convexPoly takes an array of points in only one argument. See glwrap.js for more details.

    Thanks Colludium

    This works:

    instanceProto.drawGL = function(glw) {
       var q = this.bquad;
       glw.setColorFillMode(0,0,255,1);
       glw.convexPoly([q.tlx, q.tly, q.trx, q.try_, q.brx, q.bry]);
    };
    [/code:305dxzse]
    
    But, how I can draw a line? And points with color? Is this correct? Is the only way?
    [code:305dxzse]
      var point = glw.quad(50, 50, 55, 50, 55, 55, 50, 55);
      var line = glw.quad(150,150,151,150,251,251,250,250);
    [/code:305dxzse]
  • This code it's ok, draw a blue rectangle.

    instanceProto.drawGL = function(glw) {
        var q = this.bquad;
       
       glw.setColorFillMode(0,0,255,1); // colora
       glw.quad(q.tlx, q.tly, q.trx, q.try_, q.brx, q.bry, q.blx, q.bly);
    };[/code:3g8azeha]
    
    But this doesn't draw 3 blue points: they're black.
    [code:3g8azeha]instanceProto.drawGL = function(glw) {
      glw.setColorFillMode(0,0,255,1);
      var a = glw.point(1,1,5,1);
      var b = glw.point(20,20,5,1);
      var c = glw.point(40,40,5,1);
    };
    [/code:3g8azeha]
    
    And this code
    [code:3g8azeha]instanceProto.drawGL = function(glw) {
      var x1 = glw.point(80,80,5,1);
      var x2 = glw.point(100,100,5,1);
      var x3 = glw.point(100,200,5,1);
    
      glw.convexPoly(x1, x2, x3);
    };
    [/code:3g8azeha]
    gives me this error:
    [code:3g8azeha]Uncaught TypeError: Cannot read property 'length' of undefined[/code:3g8azeha]
    
    I don't undertand how I can draw lines. I can't find a line function in c2/glwrap.js