nutmix's Forum Posts

  • Hi,

    I have two layouts, one for landscape and one for portrait (for mobile).

    They both have the same event sheet attached.

    However, when the player switches from one to the other, the layouts objects are destroyed, and I lose game state (as I was storing the game state in the objects parameters.

    I need to restore game state on layout switch.

    I tried adding an "on start of layout" event, but this fires if you resize the same layout, so not useful in this case.

    I can see a few ideas:

    1) store the layout state (portrait or landsape) in globals. I try and avoid globals for state where possible as they are difficult to manage in complex conditions.

    2) possibly detach the single event sheet from both layouts, and attatch separate event sheets that do something only once on switching to that layout, then include the main event sheet. However, I dont know what that event might be?

    3) other cunning strategy?

    Thanks!

  • Hi Ashley, its not just the text, it scales image sprites too. In the capx I posted, one of the layouts just has a backgroung image. As you change the browser window size, the image scales up/down and jumps around to the wrong place. In crop mode, it should not scale at all, and should stay centered. IE is perfect but FF and Chrome are disastrous.

    I'm guessing it's not a text specific problem, it seems to be scaling in crop mode which is the problem?

    My graphics card is a Quadro 2000M which is adobe and autocad certified, rather than a more common consumer/game oriented card.

    Thanks for taking the time to look at it anyway. If there are any more tests I can run let me know. I use crop mode exclusivly.

  • Unfortunately, appMobi etc are not options for us, as our games are casino type games which are not allowed in the stores, and we have our own existing web based payment systems.

    We have to deploy these apps in the standard browser, and find work arounds for the various issues (we can live without sound effects for now).

  • The mobile game will be opmtimised for iphone 4 and similar sizes. Retina display is switched on in the project properites, allowing 640x832 on the iphone. This will also work reasonably well in the original ipad size. Is there any way of switching off retina display (e.g. in the index.html) if ipad is detected, to not go to the silly resoluion the ipad3 provides?

    Any ideas much appreciated.

  • I found this interesting because I am going through the pain of getting basic games working acceptably on mobile, our most important platform.

    http://www.sitepoint.com/hints-for-making-a-cross-platform-html5-game/

    Interesting bits:

    When I began HTML5 game development, I thought it was a nice idea to render game using Canvas, because it?s quite useful on desktop computers. But on a platform like the iPhone 3GS, it turns out to be a bit of a headache. The game performance sucked; images were rendering at less than 5fps. I had to create rendering engines, one after another.

    Currently, I rely on the DOM (Document Object Model). It dictates the way in which my applications are constructed of HTML elements and CSS3 selectors, rather than how they?re rendered to a Canvas. The advantage of using the DOM is that the game can be much faster and more responsive, due to hardware acceleration. It?s important to test your game again and again, and I personally think using the DOM is a better choice than Canvas.

    Deal with Audio Issues

    Embedding sounds within a game is vital. Unfortunately, the biggest issue in developing a cross-platform HTML5 game is sound. Within HTML5 game development, Canvas has good support, Video is constantly improving, but Audio is still pretty patchy. Games can?t play sound and music simultaneously. Taken from this aspect, HTML5 is not necessarily an ideal Flash alternative!

    Other audio issues include:

    ?     Different browsers support different sound formats (mp3, wav, ogg etc)

    ?     iPhones and iPads allow only one mp3 sound to be loaded and played at any time

    ?     Android has limited support of the <audio> tag and the JavaScript audio API

    There are a few ways around these issues:

    ?     For the format issue, I duplicate all game sounds in two formats (OGG and MP3), which covers most browsers.

    ?     For the iOS platform, I keep sound and music in the desktop version of the game, and only music in the mobile version.

    ?     As for Android, because it supports Flash audio play, so I use jPlayer to handle automatic HTML5/Flash audio transition.

  • Excellent, glad to have some interest. Do any of your games involve traffic cones by any chance?

    I'll write up a spec of what we are looking for, but basically we will consider anything, as most games are adaptable to touch/mobile. Currently we are targeting iphone4 type resolutions (832x640)which happen to look pretty good on the dekstop too.

  • I got no takers for this work, so have done it myself. If anyone wants paid work for creating games for mobile, plugins or workarounds like this, let me know as I have plenty.

    In fact, if anyone has any skill based game which works well on mobiles which last less than a minute (or can be adapted to do so), let me know and I'll make you an offer for the source code.

    We have grapic designers, so dont worry about the quailyt of the art.

  • hmm. That sounds logical, but layout 1 defilietly is creating objects from layout 2. e.g. If I have spriteA on layout 1 and the same object copy on layout2, then radically change the size of spriteA on layout1 to be huge, and the spriteA copy on layout2 to be tiny, when the object gets created on layout1 its using the tiny version from layout2. Layout2 uses the tiny version too.

  • I have a game which was created on portrait. I then copied the layout (and all its layers and objects), named it landscape, and resized and re-arranged some of the items.

    How does construct 2 reference copies of the same object on the same layout, and on different layouts?

    Is there any way to reference the object on the current layout (e.g.

    craete object CurrentLayout.SpriteA
    

    Otherwise, how will you know which of the two objects of the same name it will pick?

    In game, the player can switch between portrait and landscape any time (e.g. by resizing browser, or turning phone/ipad).

    I have one event sheet attached to both layouts.

    It mostly works, but there are some strange effects.

    Sprite A and Sprite B were on layout1, and were copied to Layout2.

    In the event sheet, I create new sprite A object, and place it on the layout. If I resize Sprite A in layout 1 before hand, the new size is not reflected when playing in either layout1 (portrait) nor layout2 (landscape) - its in limbo.

    However, when I resixe Sprite A copy in layout 2, the new size shows up when playing in both portrait and landscape mode. This is odd.

    However, if I resize sprite B, which was sitting on the layout (not created dynamically) 1, it only affects layout one, and the same for layout 2.

    Other strange effects are that I have a version, status and FPS text field which are all updated by the single event sheet each tick. However, only two of the three text fields work - I cant get the version to work any more. Even though I am updating it, its not getting updated in either layout.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • My app uses crop mode to handle multiple sizes of mobile browser to avoid the black bars of letterbox. However, when not on a mobile device, I want to switch back into letterbox. I tried doing:

    Browser->request fullscreen - Stretch (letterbox scale)

    but this has no effect (in IE and FF at least).

    Does anyone know how to change the scale mode in an event sheet?

  • OK, reinstalled R100 in a different place, and I can confirm it seeems to work with webGL switched off. However, it works fine in R99 with webGL switched on.

    We probably cant expect our customers to have the latest drivers, unfortunately.

  • Sorry Ashley, I've uninstalled R100. R99 works perfectly, R100 doesnt for some reason. I have the latest available drivers installed from Lenovo (got a W520).

  • I cant preview in Chrome either. Using R99. FF is my default browser.

    The error message I get is:

    Unable to launch browser 'Chrome' for preview. Please ensure th latest version...

    If I hit Windows-R, and type Chrome, it opens up a file exporer with this location:

    C:\Program Files (x86)\Symantec\VIP Access Client\chrome

    I have no idea what Symantex VIP access is - I have never installed it, and uninstalled everything which mentioned it some years back.

    Chrome says it is up to date.

  • When you press the "play" button at the top of the screen, you usually see your changes in the browser.

    However, there are a number of changes which no amount of refreshing, closing opening browsers, saving the project etc will show, one of which is if you change the "first layout" in the project properties.

    To reproduce:

    1) create a new project with 2 layouts.

    2) put "layout 1" text box on first

    3) put "layout 2" text on second.

    Now hit preview which opens up your chosen browser.

    You see layout 2.

    Now in the project properties, change the first layout to be layout 1.

    Hit preview.

    You still see layout 2.

    Change the first layout as often as you want - you will only every see layout 2 in the browser.

    Close and open your project.

    Now you see layout 1.

    Here is the capx I used to reproduce:

    https://www.dropbox.com/s/3tdoj30c7a51if8/previewBugTest.capx

    Just open it, preview (you should see layout 2).

    Now change it to layout 1 - preview again and you still see layout 2.

    Save, close and open the project - now you see layout 1.

    I get the same problem with a number of other attributes and events.

    using FF 14.1, windows 7 64 bit.

  • If you set your widow size to say landscape (e.g. 640x480), then create a layout with the same size and use crop mode, the layout is always centered nicely.

    However, if you now create a portrait layout, in say 480x640, and switch between them, your portrait layout is not centered and is unusable with parts off screen etc.

    Here is a capx to demonstrate the effect, you will see that when you click to change to portrait mode, and resize your browser, its off center.

    https://www.dropbox.com/s/tz4vz0epn3vtkwo/layouttest.capx

    Is there a trick to get he layout in the middle (without changing from crop mode?) I could guess where to put the objects on the portrait layout and ignore the layout rectangle, but this is inaccurate and difficult.

    Help much appreciated