dop2000's Forum Posts

  • Do I have to import Steamworks SDK files to my Construct 3 project before exporting the game?

    No, but you can import a text file steam_appid.txt with just your APP ID in it.

    Export the game with DevTools enabled, make sure Steam is running, launch the game (directly from your drive, no need to upload to Steam). Try to activate an achievement, press F12 and see if there are any error messages in the console.

  • Most games ignore the system scaling setting and don't resize their content. Besides, in a mobile game I need to make sure that touch controls are always usable. I can't just scale things down without knowing the physical screen size. The same button may be fine on a tablet, but will be too small for mobile phone screen - impossible to control without a pen.

    I guess the safest solution is to add an in-game setting for UI scale and allow users to change it.

  • On mobile devices, your best bet is probably just to rely on the screen size reported by Platform Info. That is in CSS pixels so does not vary with the device pixel ratio,

    Unfortunately, when I change scaling/text size in my phone settings, this changes the screen size in CSS pixels reported by PlatformInfo, as well as the device pixel ratio.

    Same phone, different settings:

    CanvasCssHeight=510, pixel ratio=2.1

    CanvasCssHeight=320, pixel ratio=3.37

  • But the aspect ratio is what really matters for display on mobile devices.

    I agree, but my question was NOT about the aspect ratio.

    I need to know the physical dimensions of the screen to scale the UI accordingly. Basically, if the game runs on a 6" mobile screen, all texts and buttons will be bigger. On a 10" tablet I can make them smaller. On a 24" desktop monitor I can make them even smaller and fit more information on the screen.

  • igortyhon I think you misunderstood my question. I'm not asking about the aspect ratio. There are thousands of different screens with different aspect ratios, so this metric can't be used to estimate the physical size of the screen.

    In my above example, the aspect ratio for both screens is 16:9, but 15" screen is about 600% larger than 6" screen.

  • I am making a mobile game and want to detect roughly if the screen (window) size is closer to a phone or a tablet. Basically, if it's bigger or smaller than 8".

    I'm reading the documentation for PlatformInfo, but can't make sense of it.

    I found an old post where Ashley says it's possible to estimate screen size from CanvasCss Width and Height. But I tested on my phone and PC screen with the same resolution, and by changing display scaling settings, I get vastly different results.

    • 6" mobile screen set to smallest scale: CssHeight=510, DevicePixelRatio=2.1
    • 15.4" PC screen set to highest scale: CssHeight=618, DevicePixelRatio=1.75

    So obviously this method doesn't work.

    ChatGPT says I need one more piece of information: the PPI (pixels per inch) or DPI (dots per inch) of the screen. Without it it won't be possible to estimate the physical size.

  • Loopindex doesn't work in For Each element loops. Either use System For loop, or Array.CurValue expression.

    Actually, that's not even "For Each element" loop on your screenshot, it's "For Each instance".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • But what if we prefer to keep the original sprite orientation? I found that we can offset the angle somehow

    I don't know, it may be possible.

    Another option is to create two versions of the skeleton in the editor - normal and mirrored. Configure them as templates. And when you need to mirror it - destroy one hierarchy and create another in its place.

  • The main issue is that your sprites are rotated. You can select the lower leg sprite for example and mirror it in the layout editor - set width to negative value. You will see what happens to it.

    You will need to rotate the images in some external editor and set their angle to 0 in Construct.

    Also you need to disable Sine when the hierarchy is mirrored.

    Here is an example:

    dropbox.com/scl/fi/rhek2x89kjxmqzgxofrl8/test-mirror2.c3p

  • without using clones

    I don't think it's possible. You can use a clone sprite or paste the image to drawing canvas.

    Here is my old demo

    howtoconstructdemos.com/animation-frame-change-with-morph-fade-capx

  • So you have coin -> particle object -> effect sprite. The effect sprite is always spawned at the particle object position. If you know which coin the particle object is attached to (say with hierarchy or pin), you can accurately pick that coin.

    EffectSprite On Created
    Particle X=EffectSprite.x
    Particle Y=EffectSprite.y
    Particle pick parent Coin
    

    or simply:

    EffectSprite On Created
    EffectSprite is overlapping Coin
    
  • Use relative paths like ".keyname" to access values.

  • So what JSON string do you see in browser console?

    Not sure why you are storing each object as an array. Try this instead:

    Use "Set Value" action instead of "Push"

  • On the first screenshot - remove "Wait 0.2" and "Wait for previous action to complete", they are not needed.

    On the second screenshot - you are saving values to Local Storage on every tick, this is a big no-no. Local Storage operations are asynchronous, they require time to complete. You are basically reading and writing values in Local Storage at the same time, this is why they reset to default.

    You should only save to LS when it's safe to do so. For example, at the end of the level.

  • The only solution I can think of is to check which coin is the nearest (or overlapping) when the effect object is created.