nutmix's Recent Forum Activity

  • The supporting multiple screen sizes tutorial is a complete waste of time for mobile devices.

    As far as I can tell, very few people are using C2 for mobile HTML5

    After a month of groping in the dark and trying many different options, we took this approach:

    1) use crop full screen mode.

    2) make the backgroud 1024x1024 and center it.

    3) make the screen size iphone 4 resolution = 640x832 and 960x536

    3.5) use anchors to glue HUD bars, buttons etc to the corners/edges so they expand out to fill available space on longer thinner devices.

    4) every tick examine the screen width/height and see if its changed.

    5) if the size has changed, scale all layers except background to best fit keeping aspect ratio

    6) Hack the index.html to make the browsers address bar go away in iphone and android

    7) Export a version of the project with retina display switched off for the ipad 3. (have to detect in in js).   ipad 3 will scale up ipad one resolution, which is 1024x768 - tool bars etc. you wont be able to tell the difference.

    8) have separate layouts for portrait and landscape modes, and you have to store the state of your game as when you switch layouts, it destoys everthing.

    9) Export a version for the PC with fixed size or letter box scaling and landscape mode.

    10) had problems getting anything to work properly on iphone3 - decided not to support it (the only way to detect it is to run a speed test in js).

    11) C2 has no concept of modal dialogues, and no way to disable users clicking on sprites, even if they are invisible and hiden under layers/bottom of z-depth. you have to design your game with all the user input in a small a number of groups as possible, and then disable groups to switch of game input while diplaying psudo-dialogs.

    12) dont forget to select the option in the touch settings to make mouse input act as touch.

    I implemented swipe also, to swipe in left and right layouts with settings, info etc. There is no gesture support, so I wrote my own just tracking the touch coordinates.

    Good luck.

  • Crashed FF 15.0.1 the first time for me too.

    What is spriter? Is it the bash monkey tool?

  • No, I only access on a single laptop, but always have a couple of browser windows open on the forums.

  • It does not seem to be cookie/session related, as I can get the error after correctly posting a message, then quickly editing it and reposting within say 30 seconds.

    Perhaps the error is because the session has become invalidated due to a problem with whatever load balancing and session persistence the web system is using.

  • This seems a really supid question, but as I dont know the answer, pretty much all my code produces unpredictable and largely incorrect results I when I resize the browser window using crop full screen mode and layer scaling.

    I this mode, the actual browser window may be larger or smaller than the projects window size, which may be larger or smaller than the layout, and there may be scaling.

    There are a number of entities, presumably some of which have their own coordinate system:

    1) projects window size.

    2) viewport (no idea what this is - not in manual)

    3) canvas (no idea what this - not in manual)

    4) layer

    5) the browser window

    6) the layout scale

    7) the browsers pixel dencidty (retina display)

    8) other?

    object-> Compare X

    What is x relative to? Which of the above coordinate systems? If some of the above coordinate systems are different, how do you map between them?

    What is the difference between:

    Object.X

    Object.XAt

    Object.ImagePointX

    Touch.X

    Touch.AbsoluteX

    Touch.AbsoluteXAt

    for example?

    Thanks for any help or tips.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for that.

    Do you know what X is relative to? This is a really fundamental question, and we dont know the answer.

  • There is a main game screen, and a settings screen (where you can set the number of lines, switch sound on/off etc).

    We have spent 3 weeks so far trying to scroll the settings screen over the top of the games screen (or shift it over) with the unpredictable width of crop fullscreen mode (which is a requirement for mobile).

    We tried these and rejected these strategies:

    1) make setttings a different layout. Rejected this strategy as you cant scroll another layout in/out of the current layout, and you lose game state.

    2) put the settings form as a single sprite, move the sprite over the layouts, and try and use the cursors X&Y corrdinates to work out which button you are over. This failed as the relationship between the X coordinate of the touch event has no relationship to the object its over due to scaling, browser size, crop mode, viewport etc and these relationships seem to be undocumented. We dont know what a viewport or canvas is.

    Now we are considering putting the settings objects (buttons to increase/decrease volume etc) in its own layer with the contents to the far left outside the window area. however, how do you scroll just a single layer? We cant scroll the entire layout, as the variable screen size in crop scaling mode means we dont know how much gap to create beteween the main screen and the settings screen (if the window width was fixed, this would be easy).

    Any thoughts or strategies to try would be much appreciated.

    So far we have spent 3 times more money trying to swipe in a settings screen that it took to create the entire game.

  • Hi, I want to get a panel to slide in/out from left and right with info.

    E.g. I slide it out using a swipe gesture, then slide it back.

    I have tried lots of ways to do this (including scrolling the whole layout), but currently Im trying with a sprite.

    The question is, how do I say "tween the sprite from this X position to this X position" to show it sliding nicely across the screen and stop in the center?

    Do I need to hand write movement code which fires evey tick, and does the necessary maths and setting of X of sprite?

    Could the bullet behavior be used for this type of animation?

    Ive tried bullet, setting the right info panes angle to 270 and speed to 1000 when I detecte a left swipe, but I cant see any way of stopping it in the middle of the variable width screen. Ive tried stopping when X>=0, but X seems to have no conrespondence to the left coordinate of the window: depedning on how big I make the window X is either off screen or somewhere oncreen. Ive tried various other options, including checking to see if on screen etc and overlapping with an offset, but as I have to use crop mode with manual scaling for various different mobile screen sizes, all of these produce random results depending on the current size of teh browser window. I have no understanding of the relationship between window, layout, canvas and viewport - there does not seem to be any manual entry explaining these concepts unfortunately (e.g. canvas, window and viewport do not appear in the manual at all).

    I dont even know what X refers to when you do an object-Compare X. Is it relative to the window, the layer, the viewport, the screen, or something else?

  • Ok, solved the not being able to open the file once imported issue - renamed it to .txt and now it opens in notepad.

  • My internet connection is 100% solid - I have VPN connections, ssh and database connections to other continents open all day without interuption.

    When i remember I copy the text before hitting post, but I always forget on the ones where it fails.

  • OK, forget the last post - the dictionary object cant read json files - I thought the load action would load from file, but it only can load from hand entered text at design time.

    It looks like the only route is write a some AJAX code.

    Done this, and by luck you can use a relative URL which is just the name of your json file in quotes.

    So it works - I can read in some dictionary settings via a file at runtime.

    What is the earliest time I can do this? I need to get the entire game to wait till this has done, which is a pain.

    Im using "On loading finished". Is there an eariler event I can use?

    The format of the json file is:

    {"c2dictionary":true,"data":{"test":3,"test2":2}}

    The only problem I have now is that you cant edit the file in the single file project, you have to delete it and re-add it from somehwere else if you want to change the files contents. There is an "open" option if you right click on the file in the project, but this does nothing (for me anyway).

  • Sorry, does anyone know the format of the json text objects required to load into a dictionary? I need to create the file using notepad or similar with a bunch of key value pairs in can then load into the dictionary object or similar.

    I know XML, but dont know json. is there a json eqiv. of the DTD of the format required to load in to a dictionary?

nutmix's avatar

nutmix

Member since 16 Aug, 2012

None one is following nutmix yet!

Trophy Case

  • 12-Year Club

Progress

12/44
How to earn trophies