Ashley's Recent Forum Activity

  • By popular request here it is: how to make a game fill up the screen while

    • keeping the same aspect ratio,
    • zooming in to fill as much of the screen as will fit, but only integer zoom levels so weird stretch patterns don't appear,
    • filling extra space with black bars,
    • not wasting VRAM (you import all your graphics at normal size),
    • positioning UI elements at the same place on-screen,
    • and not blurring the display.

    I always assumed it was possible, but nobody seems to have done it yet. It has been possible in Construct Classic for a while, but I'll admit - it was a little complicated. You have to use some tricks.

    Here's the file: http://dl.dropbox.com/u/15217362/fullscreen.cap (r1.2)

    How it's done:

    We shouldn't stretch the window surface, or DirectX will probably linear filter it, blurring the pixels. So Project Propertes -> Resizing is set to "show more window content" - making the window bigger shows more pixels, without automatically sizing anything. We do the zooming ourselves.

    Project Properties -> Sampling is "Point", so nothing linear filters and blurs.

    Layout properties -> Unbounded scrolling enabled, so we don't hit scrolling limitations to do with zoom.

    There are three layers: main, UI and one for the black bars. These are all ordinary scrolling layers. This means we don't have to deal with objects going offscreen when the zoom changes, the objects are manually positioned.

    Most of the rest is Good Old Maths:

    • a global zoom is set to the largest integer size that will fit inside the screen bounds. So for example if 2x will fit, it will use that, or 3x if it fits, or 1x if the window is small.
    • some maths positions the black bars on a scrolling layer in such a way they obscure everything that you shouldn't see.
    • the UI layer is also a scrolling layer, but a UIOrigin sprite is positioned at the top left of the viewable area, so you can position your UI elements from there.
    • F and W switch between fullscreen and windowed.

    Hope that helps. Back to Construct 2!

  • Did you save and reload your project in between, or did this happen all in one session?

  • You can extend Construct 2 by writing plugins in javascript - no inline scripts in the editor yet.

  • about png 8bit > my mistake, first time i tried it didnt work by dragging image to stage, and other png did, now it works too, so it works!, its a good way to save on filesize!

    It won't save on filesize - Construct 2 converts everything you import to 32-bit PNG.

    hat i did notice is once you import with a certain name, and then delete that object en reimport you cant rename back to that first name

    Is it still in the project bar? If the object type is still in the project bar, you can't name another object to the same name. Deleting the last instance of an object does not delete its object type.

  • would be possible to add events such as scroll up and down? for mouse middle button.

    I'm not sure what you mean. There are already some scrolling actions under the System object. Do you need something that those actions can't do?

  • Aren't they supported already? Can you not import them to the image editor?

  • No, you can't seed C2's random number generator yet.

  • Hey, welcome to the forum :)

    Figuring that terrain generation would be the hardest thing to achieve for me at first, I went ahead and got started.

    If you're not familiar with how events work, procedural generation is kind of jumping in to the deep end. I think it's best to start with simple projects and build your way up from there, otherwise you will quickly get stuck!

    o here's question #1 (of many, many to come): how on Earth do I fill an array with variables?

    It all comes down to setting up some events that call the 'Set at XY' action (for a 2D grid, anyway).

    oes it start filled with 0?

    Yep.

    nd how do I key each number to be relative to a sprite?

    Do you mean actually creating the sprites from the data in the array? A 'For Each Element' (on XY axes) event should do that. Each iteration compare the current number in the array, and create a sprite based on that number. Subevents are good there.

    I was going to explain this, but I just added it in to your capx. Try this: http://dl.dropbox.com/u/15217362/tileengine.capx

    You should be careful about creating lots of sprites, though. Having too many sprites can slow down the game a lot. I'd recommend waiting until the next release or two when we add 'snap to grid', then maybe put it together in the layout editor, using tiled backgrounds wherever possible for large areas of sprites. Otherwise, the sheer sprite count could slow down performance.

  • You do not have permission to view this post

  • The array has a width of 1 and a height of 2. So setting the element at, for example, (3,3) has no effect. It's outside the array! Click the array in the project or object bar to show its properties and make it as big as you need.

    I would strongly advise you use Tiled Background objects wherever possible. Creating lots of sprites is really bad for performance. A tiled background, no matter how big, is as fast as a single sprite. So if you create 2500 grass sprites it's 2500 times slower than using a tiled background the same size.

  • I kept getting a messsage about Intranet or something

    What was that message? It's always important to know.

    Also, what browser and version are you using?

    If you hit Control+Shift+J in Firefox or Chrome after the message, are there any errors? (In Internet explorer, hit F12, click Console, then refresh the page to see errors.)

    've just been going through the basic tutorial so I doubt uploading my file would help much.

    I still would like to see the file if possible. You might have done something slightly different along the way which caused the problem.

    Construct 2 is still early in development, but all its basic features should be working just fine. I guess you've discovered a bug! Hopefully we can get this fixed for the next release.

  • You do not have permission to view this post

Ashley's avatar

Ashley

Early Adopter

Member since 21 May, 2007

Twitter
Ashley has 1,770,548 followers

Connect with Ashley

Trophy Case

  • 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
  • Forum Mega Brain Made 20,000 posts in the forums
  • x126
    Coach One of your tutorials has over 1,000 readers
  • x74
    Educator One of your tutorials has over 10,000 readers
  • x5
    Teacher One of your tutorials has over 100,000 readers
  • Sensei One of your tutorials has over 1,000,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x42
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

32/44
How to earn trophies

Blogs