boolean's Recent Forum Activity

  • Doesn't the offline cache also use local webstorage?

  • There are some good samples in this thread.

    One thing to be careful of when using drag+drop is hitbox sizes. It's quite common to have a sprite like a piece of treasure that has a fairly small hitbox that is dragged around the level, but it makes clicking on the actual sprite very hard. Usually you want a large hitbox for clicking and dragging and a small hitbox for actual game collisions. I suggest having a pinned sprite that is used for interaction with the mouse cursor and keep all collisions to the game world on the treasure sprite itself.

    It might seem obvious in retrospect, but when you end up fiddling about for 3 hours because you thought it was a bug elsewhere in your code you end up feeling a bit of the fool <img src="smileys/smiley9.gif" border="0" align="middle">

  • If you want them all as a single sprite, and assuming your sprite is using a repeated grid size you can create an empty sprite and then right click and choose "Edit Animations", then in the "Animation Frames" window, right click and choose "Import Sprite Strip". It will ask you for the number of vertical and horizontal cells and then import them in as individual frames. You then drag the sprite into the layout and set its "initial frame" to match the cell you want in your animation.

    That last step is a bit of a pain, but I don't know of a way around it as C2 doesn't have a tile editor.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's pretty heavily ingrained into C2 that newly created objects can't be picked until the next top level event. Because functions don't keep the scope of your working objects you have to repick it - thereby dashing any hopes of accessing the created object.

    Maybe Ashley can do something like give functions the option of keeping the scope of the calling method - that way the object wouldn't have to be repicked and you could still modify it. It's a bit of a longshot though.

  • By the way, I'm using the web-fonts workaround from this thread. If anyone notices the fonts go all weird let me now and I'll see if I can figure out what's going on.

  • Wow really cool.

    I went to Wikipedia in the hopes of finding out why it eventually equals pie and understood exactly 4 words on that page.

    Could someone do a 'explain like I'm 5' on how this works?

  • Here is a game I made. Hopefully you will survive, but odds are you wont.

  • .asp? Wow.

    Anyway, voted!

  • I can't help with your problem, but that was the damn most entertaining game I've played in a while. I burst out laughing when he made his little "horhoor" noise and started dancing. Awesome game <img src="smileys/smiley4.gif" border="0" align="middle" />

  • Ashley sqiddster

    So I found a way around this, at least for published versions. Try publishing the capx above and then before the closing head tag (in index.html) add:

    <script>

        WebFontConfig = {

          custom: { families: ['Conv_VAGRundschriftD'],

          urls: ['fonts.css']

        }

    };

    (function() {

    var wf = document.createElement('script');

    wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +   

    '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';

    wf.type = 'text/javascript';

    wf.async = 'true';

    var s = document.getElementsByTagName('script')[0];

    s.parentNode.insertBefore(wf, s);

    })();

    </script>

    This seems to force the font to load and all works fine. However, while that works for published games it doesn't help during preview mode (just because it's not as easy to edit the files).

    Test page using this technique

    Using the above code (with the "families" property changed to my own font family) I was able to publish my game and get it running. It still doesn't really answer why it's not working in the first place though. What technique is C2 using to load webfonts at the moment?

  • If you are using Chrome: F12 > Settings (bottom right) > General > Disable Cache. Also, try adding a question mark plus a random string to the end of your url (eg. localhost:5000?789h7)

    Edit - I just realized you are probably making changes to your game, but refreshing your browser manually. You need to run the preview again from inside C2 in order to push the latest changes to the browser.

  • sqiddster

    I might have figured out what the problem is. Can you do a quick test?

    1) Run the font .capx I linked to in preview mode with WebGL enabled.

    2) Change "localhost:5000" to "http://localhost:5000".

    Do the webfonts suddenly work for you then?

    Edit - Curious, this works if you have WebGL turned on and you are loading the font from an external source. I changed mine to point to a google font and the trick above allows it to work. However it's still not allowing local fonts to load.

boolean's avatar

boolean

Member since 22 Aug, 2012

None one is following boolean yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies