Colludium's Recent Forum Activity

  • Resizing is the problem - it's compressing/stretching the image and creating the line. I am not familiar with Photoshp's capabilities for making seamless tiles, so I can't help there - but there are quite a few free programs available that will properly create seamless tiles of any size for you (quick google search and loads will appear).

  • One way would be to put all of the rag doll elements into one Container. Then have a Function that is called when On Create RagDollHead is triggered (assuming RagDollHead is the parent of the container); you only then need to place/create the RagDollHead sprites on your layout and the Container will take care of the rest. In the On Create Function you'll have to code the positioning of the limbs and creating the joints etc, but you'll only have to code it once in your game.

  • I know you said that it's not a problem with the image - does this also happen if you insert the image into a tiled background? What software did you use to create the seamless texture and did you resize the output to fit into your sprite? If you resized it then that line could be an artifact of the compression.

  • You need to add inverted commas so the command looks like ViewportRight ("HUD") - otherwise it looks for a value of HUD variable, which will probably return zero and so give you coordinates for layer zero instead.

  • I think this should do it. Please excuse the sprites...

    This does not use the on collision check because I'm not sure that it would work all the time (I could be wrong). Here you go for my solution:

  • Imagine that the Viewport returns the coordinates of the left/right/top/bottom of the visible screen area for the layer that you specify. Subtracting the top coordinate from the bottom coordinate will give you the height of the viewable area in pixels... Have a look at Tutorial: Supporting Multiple Screen Sizes.

    If all of that still seems difficult to grasp I suggest that you press on to looking at other areas of C2 and then come back to it - some of the concepts can be difficult to grasp at first but exposure and practice will help you get used to them. You can always manually make your sprites bigger than the likely screen height/width - if they are transparent then it won't matter that they are distorted.

  • Ah OK - you want the object to fill the screen:

    Set object.Width to ViewportRight("HUD") - ViewportLeft("HUD") and do similar to the object's height, assuming it's on the HUD layer and depending on whether it's width or height you're interested in.

    Hope that's what you're after?

  • I suppose I didn't answer your question exactly! Looking at my list above, if you want to achieve option 1 then you need to obtain the canvas size and scale your sprites so that they will appear at 1:1 resolution on screen, which means they will need to be scaled in the layout at run time according to the screen resolution - because C2 will try and then scale them so they appear in true proportion to the layout on screen.

    For example, let's say you have a 64x64 sprite that you want to have rendered as 64 pixels on screen. If your original layout is 640x640 then C2 will try and draw the sprite so it appears to be 1/10 the width/height of the screen. If the screen resolution is 1280x1280 then you would need to scale the sprite to 1/2 its width/height at run time so C2 would then draw it to appear 1/20 the screen size - which would still be 64x64. Add in the complication of different aspect ratios and you'll begin to see that this is not a good place to go - because you haven't even started you game mechanics yet!

    I would advise steering clear of this to begin with and I can't think of many game options where this would be an attractive proposition (there are some, though...).

  • vitorfgd, that is a very complicated subject and you need to be sure of exactly what it is that you want to achieve.

    1. Do you want the sprite to take up exactly the number of pixels on the screen irrespective of screen resolution? For example, a 128x128 sprite will look ok on an 800x480 screen but it would look really small on a full HD 1920x1080 screen - and the apparent difference in size would be very striking if the screen dimensions were about the same.

    2. Do you want the sprite to take up the same proportion of the viewable screen length/width irrespective of screen resolution or aspect ratio? C2 handles this option very well with its Scale Outer scaling option (and the others, but they are less on mobile usable IMO).

    The common advice is to draw your game for the largest aspect ratio you can expect (16:9 or 16:10) and then ensure that your background fits smaller aspect ratios to good effect. There are some great tutorials and threads on this, so do a quick search and have a look through. It's not a decision you can just glibly ignore at the start and then hope to fix later in your development. It also depends on your export target - I understand that C2 does scaling very well so, providing the sprites have the detail, you could draw all of your sprites and layout for 800x480 for example, with each sprite drawn at 1/2 scale, so that if there is any upscaling to be done (full HD / retina screen) then the upscale of your sprites can be done by adding that detail rather than by interpolating pixels. Again, plenty of tutorials ect will cover this better than I can. Personally I have scaled my last few apps to a middle of the road aspect ratio that is better suited for iOS - something like 960x640 or 1136x640 - both are ok for android and iOS and the scale outer can make some exports look longer and some look wider, but I'm personally happy with the average appearance. Whatever works for you...

  • Always happy to help! I found these forums extremely helpful when I first started (I'm hardly an expert now!) so it only seems fair. Feel free to ask away when you get stuck.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • My best advice is to roll your sleeves up and experiment with some of the tutorial examples - reading will only give you 50% understanding at best, IMO. At some point you've got to start learning to take control of C2 and understand what it's doing for you and what you have to ask it to do for you - because it is very flexible and powerful but it's not able to read your mind.

    Regarding the white bars - just make your background bigger so all aspect ratios are covered - I normally use a tiled background that is sized way bigger than the planned screen size so that, when the aspect ratio is changed, none of the background's edges are visible.

  • Exactly. Just keep an eye on those threads, I'm sure there'll be a breakthrough and that's where it'll be announced first. When is a different question....

Colludium's avatar

Colludium

Member since 26 Aug, 2013

Twitter
Colludium has 11 followers

Connect with Colludium

Trophy Case

  • 11-Year Club
  • 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
  • x3
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies