johnsrd01's Forum Posts

  • Further tests:

    • Timer set to 10 seconds --> triggers in 15 seconds
    • set to 20 --> triggers in 30
    • Tried not starting the Timer from a function --> nothing
    • Tried writing my own timer, subtracting dt every tick --> same result

    Only happens when I host the room on the computer running the game at 20 FPS. Reason for that is, it's an older computer with integrated graphics, and no WebGL support. When my more powerful computer hosts the room (60 FPS), everything works fine.

  • Hey,

    I have noticed that a Timer that is set for 4 seconds triggers correctly on a computer running the game at 60 FPS, but it only triggers after like 6 (six) seconds when run at 20 FPS.

    How is this?

    Edit: I didn't mention it, but I was talking about a multiplayer game. I tested it in a not multiplayer game, and it works just fine. Is there a problem with the Timer in multiplayer? Only the host starts the timers, reacts when the timers trigger, and updates the peers.

  • Okay, so I've learned that contextmenu events don't work in Firefox on disabled elements. My Textboxes must be disabled for them to look like text, because otherwise there's a caret and in-game RMB events don't fire.

    I'm gonna wait a little more, maybe somebody knows the magic trick, but I can foresee an increase in my memory usage because of Spritefonts... I use different font faces, styles, sizes, colors, etc. Shit.

  • johnsrd01

    Try this one:

    Thanks man, exactly what I was looking for!

  • Thanks for the replies, but still not working. Context menu still appears in Firefox when I right click a Textbox.

    I don't mind if Shift + RMB brings up the context menu, as I'm not trying to defend against content theft, since this is not the right way to do it. It's easy to work around it. I'm talking about simple right click on a Textbox. I use CSS user-select: none, but that only prevents highlighting the text.

    I've tried a couple of other scripts as well, none of them seem to work. And yes, I'm using the latest Firefox.

    Other ideas?

  • Hey,

    I have a game that makes excessive use of right click and has a bunch of transparent UI (text) elements on the screen. Now, those "Text" objects are really stylized Textbox objects. I use the Advanced Textbox plugin + some extra CSS. This is because making Text look the same on all browsers is a nightmare, and Spritefont isn't flexible enough for my needs.

    I know C2 prevents context menu from opening on right click, but that's not the case with Textboxes apparently. I've added a little Javascript using the Browser object:

    document.oncontextmenu = document.body.oncontextmenu = function() {return false;}

    Works fine in Chrome and Opera, but NOT IN FREAKING FIREFOX.

    How do I disable context menu from appearing in Firefox when right clicking a Textbox?

  • So, I as I said, SpriteFont is not an option.

    What about using TextBox and styling it using "Set CSS Style" action to make it look like simple Text? Because TextBox positions correctly.

    Is there any reason (performance, compatibility, something like that, not because it's a funny workaround) not to do it?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • IN CASE NOTHING ELSE WORKS:

    Or an awful solution could be if you use the "name" property of the browser object and -> if firefox -> reposition texts.

    It even hurt writing this all down

    Haha, that would be madness.

    Uninstalled both browsers using Revo uninstaller, reinstalled them, still nothing. Tried Rex's Tag Text plugin, same issue. With that, I have yet another problem: it only positions correctly horizontally if I use left alignment, or if I use Firefox, where it works fine. There's something funny going on on my computer...

  • Thanks for the reply Borgi.

    I've heard that too, but I don't think it would be this severe.

    Interesting thing is that I used a Google web font, and after disabling it and using default Arial they are now positioned correctly, aside from the minor rendering differences you mentioned. But I don't really want to use Arial.

    Spritefonts aren't really an option for my game though.

  • Hey,

    I've been developing a game, and it's only been tested using Chrome in preview. I've looked at it in Firefox, and I noticed that the Text objects, and only the Text objects appear a bit higher up, as if their Y coordinates were changed, but I checked in the debugger and that wasn't the case. I've tried playing with the Anchor options, but nothing made them look the same.

    I use the latest version of both browsers, and of C2 as well. I'm talking about desktop browsers.

    Any ideas?

    Thanks

  • Thanks for the reply lennaert, the rex plugin did make it better. Still not exactly what I was looking for, but I don't even know if it's possible in C2 without involving Physics.

    Imagine a 250x30 solid rectangle on the layout with it's angle set to 45°. I have a 130x130 circular object (not solid) with 8Direction behavior. When you move it up against the side of the rectangle, that's when these weird things happen. This "push out" thing basically prevents them, but what I was looking for is a smooth "sliding" movement along the side of the rectangle, when the 8Direction object is pushed against it.

    I could settle for this solution, but if somebody has any idea, please let me know.

    Thanks

  • Still trying to figure it out, any suggestions would be greatly appreciated.

  • Hey, I have a game where you control circular objects with 8Direction behavior, which you know is blocked by solids. There are also solid rectangles on the map that could be at different angles. You're not supposed to be able to pass through them, which works fine, but my problem is that movement near those objects is not smooth, especially when the solid object is at 45° or something like that. You usually have to move your 8Direction object back to continue moving, which is pretty annoying already, but sometimes it even gets stuck.

    I use cut transparent pixels, and my collision polygons are fine.

    How can I solve it without involving Physics?

    P.S.: I'm intentionally not posting the capx, because it's a pretty hefty one with hundreds of events, and I think it's a general enough scenario.

    Thanks