dop2000's Recent Forum Activity

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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".

  • 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.

  • I think you need to disable unbounded scrolling in layout properties.

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 250 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x4
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies