tulamide's Recent Forum Activity

  • No offense intended, but all the people in this thread gave you comprehensive answers. They are as easy as possible. If you still don't understand, you need to learn the basics first. When working with graphics, terms like resolution, aspect ratio, ppi/dpi and size are key to a developer world that consists of a vast variety of display sizes, ratios and resolutions.

    You repeat saying you are new to this. Still, it seems you're hoping for an all time, no learning needed solution: There is none. You need to learn the basics. If explanations are not understandable to you, use the old but still valid method of trial and error. Do prototypes and test them, until you achieve the result you want.

  • I think I understood the question very well:

    2. Can i draw something in 100x100 pixels and keep the ratio of it when viewed in the iphone5, WITHOUT it changing?The answer to this question is, as I said, yes, it keeps the ratio, it doesn't change at all.

    But that's not what you wanted to know. The question was wrong. So if you make the right question you'll get the right answers.

    Now to your new question:

    If i draw something in 100x100 pixels. Let's say it is 3 CM. Once important under the retina display it will still be 100x100 pixels but WILL it become smaller, to the eyes compared to when i draw it on photoshop on PC?How many cm a digital image will cover depends on its ppi or dpi value. For digital media ppi is the right measurement, for printing it is dpi.

    ppi means pixel per inch and desrcibes the pixel density in relation to its size of a digital medium, like a display. Under Windows you have the option to use several pixel densities, but the most common is 96 ppi. With such a density, a 100x100 pixel image will cover 1.04167 real world inches (~2.64583cm)

    The iPhone 5 display is said to have a density of 326 ppi, so a 100x100 pixel image will cover 0.3067 real world inches (~0.7791 cm)

    IMPORTANT: The image doesn't shrink! It just looks smaller to the eye. It keeps the same amount of pixels.

    I'm no expert in Photoshop, but in GIMP there's a viewing option called "point to point", which makes sure, every pixel of the image fits to one pixel of the screen, when in 100% view mode. If you turn that optin of it will be displayed according to its density. So, if I create a 100x100 image with 326 ppi and deactivate "point to point", I see the image in exactly the real world size, the eye would sense it on the iPhone 5. Since Photoshop is the professional, costly image editing software, I'm sure it has such an option also. I just can't tell you the name, or in which menu it hides. Maybe some Photoshop expert can help here.

    So, basically, there is no other way than making them in a higher pixel size, or, as I said in the first post, use a smaller 16:9 resolution an scale it to fullscreen.

  • 3.) Everything visual has an aspect ratio, which is the relation between width and height. An iPhone 5 display for example is a rectangle with a ratio of 16:9. That means that for 9 units in height it uses 16 units in width (landscape mode).

    2.) Regarding the answer to point 3, why should the aspect ratio of an 100x100 object change?

    1.) After answering point 3, it means, that everything with a final output aspect ratio of 16:9 can be displayed exactly fitting the iPhone 3's display. For example, a picture with 8x4.5 cm, a wallpaper with 32x18 inches, a video with 640x360 pixel, or a game with 1280x720 pixel.

    The resolution of 1136 x 640 pixels means two things:

    a) All visuals with a 16:9 ratio that doesn't fit exactly to that pixel size, will be scaled. Scaling doesn't change the aspect ratio, just the number of pixels used to display it.

    b) 1136x640 is not exactly 16:9, it's a bit more stretched horizontally. A true 16:9 aspect ratio would either be 1136x639 or 1137.77~x640.

    If you want to support the aspect ratio of the display, just use a size for your game that has a 16:9 aspect ratio and use the fullscreen option.

    If you want to support the resolution of the screen, use 1136x640 for your game's size.

    In both cases, the aspect ratios of your objects won't change.

  • If you mean just certain layers, then you can flip horizontal by using what Joannesalfa proposed, with 180? as the angle. A vertical flip would be difficult (I can't think of any C2 option right now that would allow that, besides "set flipped"/"set mirrored" specifically for sprites)

    If you are looking for a vertical flip, or if you meant a portion of the output (like just the left half of the screen) by "part of the screen", it would have to be done with an effect as of now. HLSL (used in my effect for CC) is pretty close to GLSL, so it shouldn't be a problem to use the "flip layout"-effect as a base for a C2 effect, for someone who already programmed a pixel shader in GLSL.

    I'm afraid I won't have the time to do it, as I am concentrating on other things in my life.

    EDIT: rotating the layer by 180? equals to both, vertical flip/horizontal mirroring at the same time.

  • Maybe the browser plugin helps? Since node-webkit is more or less a Chrome browser, the browser plugin's action "Close" might work? Wild guessing...

  • That's not easy to answer, because of the scale mode. I don't know the exact values, nor the exact algorithm. It would be best to ask Ashley for the exact way of calculation. But I would guess, that "inner scale" always makes sure that the scale chosen results in a size equal to or greater than the new window size.

    Example:

    The starting window size of the project is 640x360.

    We know the original aspect ratio from that size, which is (y to x)1.77~ or (x to y)0.5625

    The new window size is 1024x720.

    Calculating y from 1024 results in (1024 * 0.5625) 576

    Obviously 576 is a lot smaller than 720, which would show more of the scene. Inner scale prevents that, so let's try the other way round.

    Calculating x from 720 results in (720 * 1.77~) 1280

    Since 1280 is greater than 1024, it won't reveal more of the scene, but instead hide a good portion of it. This is what inner scale is for, so the resulting size will be

    1280x720, cropped to 1024x720

    Now to the scale. We have the original size of 640x360 and the new calculation of 1280x720. So the scene is scaled by the factor 2. (You can calculate that from either width or height, since the aspect ratio doesn't change)

    But again, this is to be taken with caution. It's just how I would do it. Ashley may have used another algorithm, since he is a professional programmer, which I am not.

  • I am very sorry that I contributed to your confusion. On default, every array added to a project is set to global. So just ignore that sentence and instead add the arrays to your project on the first layout, and they will be available throughout the whole game.

    Unless you want to load them per layout. Then you'd adding them on their respective layouts and set the global property to "no".

  • It doesn't lock in a frame, it does what you told it to do. As long as the value is between 1 and 119, the animation is set to startWalk with the order to play from the beginning. And this condition is true for many ticks. So on every of those ticks, the animation is set to frame 0. Also, can you assure, that the speed will be exactly 120 (and not 119.99999 or 120.0000001, etc.)? It might be better to use "else" instead. For the first issue, just add a "trigger once" condition to both parts.

    +p.direction = left
    ++Left arrow is down
    +++ direction speed > 0 and direction speed <120
        trigger once ->Set animation startWalk
    +++ else
        trigger once ->Set animation walkcycle
    
    etc.
    
  • There is no real disadvantage in using one array per biome. They use the same amount of RAM as one multi-dimensional array (apart from a little negligible overhead), they are accessed at the same speed, they are loaded when needed (when changing layout) so the loading process is a few ms faster and you might feel more comfortable with seperate arrays.

    Copying an array to a dictionary and clearing it for a new biome (and copying it back to the array when needed) will be the slowest and most expensive solution. I wouldn't recommend it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Or, if you want to save on events, use min() in your calculation.

    player picked up health -> set health to min(health + whatevervalue, 100)

  • Does anyone know how to calculate the aspect ratio (formula) ?um...width / height

    16 pixel width, 9 pixel height -> aspect ratio = 16 / 9 = 1.77~ (or 1.77~:1)

    32 pixel width, 24 pixel height -> aspect ratio = 32 / 24 = 1.33~ (or 1.33~:1)

    Real life example:

    You want 5x5 blocks. Display size is 640x480.

    -> Aspect ratio 640 / 480 = 1.33~

    -> 480 / 5 = 96

    -> 96 * 1.33~ = 128

    -> block size = 128x96

    The shorter way is of course to just divide width and height by the number of blocks per row and column. EDIT: Ups, that's just what you do!

    EDIT2: Or do you mean, you want the integer aspect ratio, as are seen on descriptions for monitor resolutions etc. (e.g. 4:3, 16:9, ...)? In case you do, this is done by calculating the greatest common divisor of both, width and height. Try the demo capx, it uses a recursive function to calculate the gcd: integer aspect ratio

  • <img src="http://media.marine-geo.org/files/images/1999-Shank_Timothy-511.preview.jpg" border="0" />@sqiddster I should have guessed <img src="smileys/smiley36.gif" border="0" align="middle" />

    Here's an eighth of me. Or is it a tenth? I guess, the graphic artists among us could tell me from their intense guidelines drawing for characters <img src="smileys/smiley4.gif" border="0" align="middle" />

    <img src="https://dl.dropboxusercontent.com/u/11182740/pictures/privates/avatar.png" border="0" />

tulamide's avatar

tulamide

Member since 11 Sep, 2009

Twitter
tulamide has 3 followers

Trophy Case

  • 15-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

17/44
How to earn trophies