Magistross's Forum Posts

  • Mostly the lineheight. After a few quick tests it looked like setting line-height to the font size + 3pt was a correct estimation. But it might not hold true for all sizes and font-family. Also, if the wrapping in the div did not occur exactly the same as in the canvas rendering, everything's going to be off.

    edit: After a few more hacking around, I noticed that upon rendering, text instances have a javascript property called "lines" that get filled with an array of objects representing the wrapped lines. I used this array to create the div instead of the text property and it seems to work better as it creates a consistent wrapping. The only drawback is that the text object has to be rendered at least once before you can use the lines array.

    Try redownloading the file to see for yourself.

  • Here's my attempt. Not perfect but I guess it's a start !

  • It's a stretch, but maybe you could use javascript to create an offscreen div, set its size/font corresponding to your text object, and THEN use the method I described. I think I might try it... I'm curious !

  • At least one instance of an object must exist. What I usually do is create an empty eventless layout and put all my dynamic objects in it.

  • You won't have the choice to NOT have a hacky solution !

    You could use javascript to wrap your letter in span element, then retrieve its relative position with jQuery. However, if you insert a sprite over your text, it won't shift it at all, you'll have to do it yourself if that's a behavior you wish your text to have.

    edit: Just noticed the text object is actually rendered in the canvas and isn't an html element... this will complicate things a bit...

  • Are you talking about an actual editable textbox or a simple text object ?

  • Change

    this.easystarjs.enableDiagonals();

    to

    this.easystarjs["enableDiagonals"]();

    for example. i.e. change the style of the name in external js call.

    Then the name would not be minify.

    rexrainbow I see, should be a simple enough fix. How about the actual instanciation of the easystarjs, will the compiler break the "new EasyStar.js()" call ?

    edit: Nevermind, obviously I had to use the same notation as you said, and go with "new EasyStar["js"]()"

    newt Behavior files were updated with the quick fix, it seems to work as intended now when you minify.

  • Try removing the "player: Set xLoopIndex to 0 " on line 21. It seems to do the trick... most of the time :\</p>

  • The loops first had to be unified, that's why you couldn't see it !

  • Oh, I meant the runtime and edittime of the behavior. There's an external file called easystar-0.1.13.js, I think that by copying all its content over to the runtime.js of the behavior, it should allow the minification to perform without breaking anything. The "dependency" inside the plugin setting (edittime.js) should also be removed.

  • According to this, I'd have to create an extern definition file and supply it to the command line when calling the minifying module. However, we have no control on how the module is called, so I guess it's tough luck for minifying when using an external library. However, you could probably incorporate the JS file of the library inside the runtime.js and remove the dependency inside the edittime.js, and hopefully let the closure compiler do its magic withtout breaking anything...

  • I modified the capx a bit. Unified the loop, and added an event to force the y movement to happen if the player is moving horizontally while "floating".

  • Its breaking nw.js with minification.

    Probably has something to do with the fact that I used an external JS file. I'll investigate further when I get the chance to !

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I believe you were talking about my tilemap behavior ? You could probably still use it. Simply set the cost of any non-track tile to something absurdly high. Doing so, a path will always exists, you'll simply have to detect when your train step on a non-track tile so it explodes to smithereens !

  • Dependency are defined in the edittime.js file. As per the manual :

    dependency

    This one isn't listed above, but if you need external files bundled with your plugin (e.g. a javascript library) you can specify one or more dependency files with:

    "dependency": "file1.js;file2.js;file3.html"[/code:wxse6q3n]