Ashley's Recent Forum Activity

  • 1. Is better for performance to use a TiledBackground instead of filling the field with Sprites?!?

    Never have a grid of sprites! It's very slow. You should use a Tiled Background with a texture that is a power-of-two size (e.g. 32x32, 64x64, 128x128...). Tiled backgrounds at that size can draw as efficiently as a single sprite, no matter how big they are!

  • You still haven't fixed hog2 - it's not a fair test at all because it's much smaller than hog1, so only a fraction of the canvas needs to be rendered, so there's much less work to do.

  • In 2) the width and height attributes are missing from the canvas tag in the HTML, so it reverts to browser default (300x200 IIRC). 1) has the attributes present so displays correctly.

    If you want to measure speed, you should also throw in a text object and set it to fps every tick - then you can see the fps instead of trying to tell which looks smoother!

    I'd also be interested to see if there's any difference on iOS 5 - apparently the canvas has been sped up a bit in that.

  • As before, a new dev poll for what you need most next. We're still prioritising the image editor and animations which should come soon, so it's not in the poll. Fine collisions will be based on features in the image editor, so that too will have to wait. In the mean time though, which features are you missing the most?

  • Oops, I broke solid in the refactor. Attached is a fixed runtime.js, paste it in to exporters\html5\behaviors\solid to fix.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I found out some more about how to get AJAX requests working. I've edited the OP with more info.

  • Download Construct 2 public preview 39

    Link to release 38.2

    Three new plugins and a few bug fixes this build. The new plugins are Ajax, Array and Browser. See the changelog for more!

    Edit 08/06/11: Some updated info on the AJAX plugin: Modern browsers prevent cross-domain requests for security reasons. This means a page on scirra.com can only request other pages on scirra.com. Another difficulty is files on disk count as a different domain too. Construct 2 previews your game from files on disk. Therefore, requesting any page from the internet will fail in preview mode, because going from disk to the internet is cross-domain too.

    However, servers can be set to respond to cross-domain requests. This is generally only done for things like data services, but if the server sends this HTTP header:

    Access-Control-Allow-Origin: *

    then the page can be requested from any domain - other servers, or files on disk. That means it works in preview too! For example, if you are requesting your own PHP file from your own server, you can add this line to the PHP script:

    header("Access-Control-Allow-Origin: *");[/code:3oe4d6vi]
    
    This will make requests work when previewing.  This makes testing it a lot easier.
    
    The only other alternative is to export the project and upload it to your server to test the AJAX requests.  That's kind of slow, so if you can get it to send out that header, that will make life easier for you.
    
    Remember you still can't make cross-domain requests by default, even when the script is online, unless the server you are requesting also sends out an Access-Control-Allow-Origin header that allows your domain.  You might be able to contact the person running the server and have them modify it so your application works, but this is only likely to work if you know them or work with them.
    
    Hopefully that will help you make the most of the AJAX plugin.  Please remember these limitations aren't Construct's fault - the internet is designed like that for security reasons, so we have to work with that.
    
    [h2]Changelog[/h2]
    [ul]
    	[li][Add] Browser plugin: can navigate to pages, get browser details, etc.[/li]
    	[li][Add] AJAX plugin: request URLs dynamically as the game runs.  However, cross-domain requests are limited, and requests in preview may fail.  See caveats above.[/li]
    	[li][Add] Array plugin: like with Classic, store arrays of values in up to three dimensions.[/li]
    	[li][Add] 'Edit texture' context menu option when right clicking objects with textures in a layout.[/li]
    	[li][Change] Upgraded bundled jQuery version from 1.4.4 to 1.6.1[/li]
    	[li][Fix] False-positive assert failure ("system_expression != NULL").[/li]
    	[li][Fix] Multiple spaces in expressions were collapsed to a single space when saved and loaded, due to an incorrect XML parser setting.[/li]
    	[li][Fix] Layer 'initially visible' setting was mixed up with the 'visible in editor' setting when loading a project.[/li]
    	[li][SDK] Runtime scripts have been refactored to be simpler and minify better.  It should be a bit easier to write plugins and behaviors now, and minified runtime scripts are a few kb smaller.[/li]
    [/ul]
  • If you only want to save VRAM, it would be better to simply add proper non-power-of-two texture support to Classic, like C2 already has with OpenGL. I can't remember if DirectX 9 supports it though. With non-power-of-two support, images take up exactly their size in VRAM, no more, no less, nothing to be saved by slicing up.

  • I thought the point was the convenience of having the objects grouped together rather than to save VRAM?

  • You can define nine cells of the panel object, but I realise that's more for stretching and UI. I guess you want a sort of "composite object", which is made out of other objects but acts like one?

  • You do not have permission to view this post

  • Have you seen the Panel object? Is that what you mean?

Ashley's avatar

Ashley

Early Adopter

Member since 21 May, 2007

Twitter
Ashley has 1,770,026 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