0plus1's Recent Forum Activity

  • Ashley this has steered in a direction that wasn't part of my post. Basically what I "asked" from you is:

    1) Preview on lan that actually starts from a folder to put there file we are loading with plugins or external js (eg callJS Inject ..)

    2) Native callJS, an API or a way to define function INSIDE the c2 class that we can manipulate AFTER "compiling". Basically a way to manipulate the code of C2 after "compilation" without messing with your code.

  • Take this capx: LINK in this CONTEXT

    Is there any way to make sure that c2 has finished any of its internal stuff (like scaling, stretching the sprite and so on)?

    Before telling me that it already does on start try my capx you'll see that in reality c2 still does stuff way after on_start.

    Thanks

  • Joe7 the problem in preview is not only callJS, but also lazy loading and all the stuff that picks files outside c2. Yes everything could be made into an hack, and basically is what we are all relying currently to achieve even simple stuff. My point remain though, it would make life a lot easier to have the ability to "inject" files inside the preview runtime.

    The TextBoxes id is nice, but it's a drop in an ocean, basically it's not enough to manipulate the canvas, but it's a start.

  • Thank you, you fixed my problem! I owe you!

    But still, while your solution works, there is actually no need for my way not to, and I would love an explanation from Ashley because there is a big discrepancy between the window size and the actual canvas size that c2 produces!

    Basically, the only way to get the actual canvas size is to get the Width of the stretched sprite (as per Wishy method). But surprise! There is no safe way of doing it. Check this example: dl.dropbox.com/u/1606950/wtf2.capx

    On the start of layout the size of the Sprite is equal to the layout size. Then the first "pass" to a true condition it goes to 0x0 then it goes to the "magic" number that the canvas get.

    In my real game, debugging the same way, it needs two passes to get to the "stable" value, the first 0x0 the second a number that rounded is almost the final value, the third the "stable" value.

    Now I understand that the "stretching" is a behaviour that probably doesn't get initialized at the start of the layout but after a while (an unpredictable while by the way), why isn't there an event that tells us when everything is actually ready from the engine perspective?

    Can you implement a way to retrieve the actual canvas size? Why isn't there an event in case the user resize the browser?

    I hope this doesn't get ignored..

  • Wishy yes! It is! How do you do it? Scale mode? No Fullscreen? Parallax.. can you fix my capx to make it work so I can see how you are doing it?

  • Arima thanks for trying.

    Basically I'm trying to find a way to STRETCH (withouth mantaining proportions) the background of my app, so that even if the aspect ratio is not 1.5 (iPhone) the background covers the whole screen. The element are then repositioned while mantaining their aspect ratio, only the background sprite will become "deformed".

    To do this, after checking the aspect ratio, I change the width of the background to WindowWidth/2, this is because since the canvas is scaled by 100% it SHOULD double.

    In reality there is a discrepancy between the canvas that c2 creates and the real WindoWidth, probably this is a bug or I am simply ignorant.

    Open my capx if you can, I added an event.. click on the rightmost pixel of the screen and you'll see that there is a discrepancy.

    EG:

    640x1366(res) aspect ratio 0.47..

    Rightmost Pixel-> Mouse.X = 1019, Absolute 1365 (which is the window-1)

    Another EG:

    596x570(res) ratio 1.04..

    Rightmost Pixel-> Mouse.X = 458.4, Absolute 569

    This changes as the aspect ratio changes, going from a few pixels to huge gaps.

    If I can get the REAL canvas size of C2 I would've fixed my problems, because I would set the W varible to the real width that C2 is using.

    I need it to be precise to reposition object (for example sprite set X = (Width-3)-(self.Width))

  • Ashley, can you at least tell me the method that handles the scale mode resizing in the exported c2 unobfuscated code so that I can take a look at it?

  • Bump? Please someone! I'm desperate..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Isn't LAN preview there to remove all the tedious compiling process ?

    I'm sorry but did you actual read what I wrote?

  • I partly fixed this.

    I understand that since the Scale Rate is 100% the width SHOULD be multiplied by two. If you change my capx setting W to WindowWidth/2 and now it almost works, but there is a percentage of error that changes based on the width of the medium and that I don't understand. Help Ashley!

  • I'm stretching a sprite width do match WindowWidth, the resulting width is completely unpredictable and doesn't correspond with reality.

    I included a capx(link) and a preview (URL).

    Please help me, I don't understand this!

    EDIT: The window size is always correct, is the resized object that do not make sense.

  • I'm stretching a sprite width do match WindowWidth, the resulting width is completely unpredictable and doesn't correspond with reality.

    I included a capx(link) and a preview (URL).

    Please help me, I don't understand this!

0plus1's avatar

0plus1

Member since 29 Dec, 2010

None one is following 0plus1 yet!

Connect with 0plus1

Trophy Case

  • 13-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies