stowersc's Recent Forum Activity

  • I'm relatively new to Construct, but have decent javascript knowledge.

    I need to send some save data OUT of construct runtime so i can store it on a server. I'd rather do this by sending variables out from a Construct function and in as parameters to a regular javascript function of my own (that sits outside of Construct).

    I can access global variables ok i.e runtime.globalVars.myglobalvar

    however i can't do the same for an array.

    What is the best way to send the contents of an array out to my own script?

    Or is there a better way than accessing runtime.x.x.x? Surely there is a way to use the direct variable names inside a construct function, or sending them out via some pre-packaged action. I'd have thought this is a pretty common request.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • not sure if this will help or not...

    for a lot of the database work I do I resize the canvas to the window dimensions so that I get a 1 to 1 pixel size. That way one pixel wide lines don't scale / get blurry.

    So, I tried similar logic to limit the canvas size. My sample project below turns off scaling, and just resizes the canvas based on the window size. I clamp the values to limit how big (and how small) the canvas can get, and re-position objects as necessary.

    I create a red dot on each touch to show that the touch coordinates are correct. If the window gets too big, the canvas size is limited - which results in a black bar on the right and/or bottom. (not sure if the canvas can be centered). C3 still recognises touches outside the canvas area, so I filter those out...

    I have no idea if this will affect performance the way you hope.

    https://www.rieperts.com/games/forum/ScreenSizeLimit.c3p

    Thanks for your example and ideas but I don't really have the option of manually moving / scaling objects within Construct logic so the game is always centred. It's a huge pre-existing project I've inherited. If I did your solution I'd have to constantly manage the viewports positions within Construct right?

    I'm talking about the canvas object on the index.html page. I've figured out how to resize it permanently by "hacking" the main.js file. Problem is there is a touch logic layer somewhere that is not translating the touch events appropriately. The logic is actually pretty weird and over complex if you ask me. I find it very surprising that the Construct devs didn't make the way the canvas is displayed more flexible...

  • I'm not talking about changing the base resolution of the game. I'm talking about limiting how it scales.

    One of my clients is complaining that a Construct 3 game is running VERY slowly on certain computers with large screen resolutions. When he resizes the window to be smaller the game runs perfectly. I agree with him that limiting the size of the game SHOULD be an easy fix but unfortunately Construct 3 doesn't seem to have an obvious option for this.

    I have tried and to modify the canvas size manually using javascript but I'm having issues because:

    a) Construct will override this on occasion (resize window etc)

    b) Even if I change the canvas values the touch event positions don't scale and so all touches are "off target"

    I have tied to embed the game inside another html window using <embed> or <iframe> and resize the parent accordingly. It works fine on my test server but unfortunately the clients LMS website blocks scripts on child embeds. imo I should not have to resort to embedding to perform such a simple task anyway.

    How would I go about changing the way Construct scales the game and make it "think" the window is smaller than it really is?

    Thanks for reading and any help you can offer. I'm new to this engine and have picked up a few jobs requiring that I edit existing projects. It has been smooth sailing up until this point.

stowersc's avatar

stowersc

Member since 4 Feb, 2021

None one is following stowersc yet!

Trophy Case

  • 3-Year Club
  • Email Verified

Progress

4/44
How to earn trophies