clrammer's Forum Posts

  • I know I'm late to the party, but this behavior is awesome. Thank you!

  • R0J0hound

    Thought you might be interested in knowing that the Clear to Color action was behaving unexpectedly for me when plugging this into my project and testing on iOS via CocoonJS. I thought maybe I was just using it wrong, so I created a fresh capx and it worked just fine. Obviously, it has something to do with my project, but just for your info when I use Clear to Color, instead of filling with color a snapshot of the entire canvas (i.e. the game window) is taken and pasted upside down in the Paster object. This is the exact same functionality I was getting when testing out C2's built-in "System > take snapshot of canvas" action a few weeks ago.

    The workaround I chose was to create a pure white tiled background, fill the screen, then use the Paste Object action on the Paster object, then destroy the tiled background. This works great with no performance issues, however I thought maybe you would be interested in the report.

    Thanks!

  • Really great to see this adapted for WebGL.

    Edit: Never mind about the comment I had here initially suggesting there was an issue with positioning. Resolution error on my part :)

    Keep up the great work!

  • I am getting the same error. Same OS and C2 version as hellwalker.

    **Edit: I apologize for not posting a .capx. This is occurring in the project I've been working on for a few months. It's quite a big file and something I intend to sell commercially. I'm happy to answer any questions I can to help find the issue.

  • As a follow up, I do not get a javascript exception when using a Tiled Background instead of a Sprite, however I am unable to flip the tbg to correct the image.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi

    I briefly experimented with using the system "Take snapshot of canvas" action with CocoonJS. I actually did have success in sending the snapshot to WebStorage and then using the "Load image from URL" function of a blank sprite object and entering the WebStorage.LocalValue contents. Interestingly, I had to Flip the sprite for it to display properly.

    However, I believe there are several obstacles to work around, as I was getting a Javascript exception ('requestAnimationFrame'): texImage2D IllegalArgumentException: Cannot open the given '/private/var/mobile/Applications/blah blah extremely long series of characters that expect represent the JPEG image in WebStorage. Not sure why I get this, as the sprite is deleted when I change layouts and I only get the error when trying to go back to the layout where I originally displayed the sprite.

    Anyway, figured I would post and see if any of that is helpful. :) I'm on the latest C2 release, r143, and CJS 1.4.

  • This is my favorite changelog entry ever:

    "[fix] A typo fix and a few other fixes that I don't recall."

  • R0J0hound

    Thanks for taking a look at a full WebGL fix. Even without a full fix, the improvements so far have been great.

    Is this something that Ludei could actually address from their end, or would the fix have to come from the plugin?

  • R0J0hound

    Thank you so much for the improvements. This helps a lot with the app we're working on!

  • SirSpunky

    Thanks for the info. Quick summary of my situation:

    1) One canvas object, about 50% of the screen, used exclusively to draw lines (drawing with your finger).

    2) With CJS 1.3, performance on iOS was great (60 fps). Performance was stellar in Chrome as well.

    3) After CJS 1.4, performance on iOS dropped to 9 FPS even when idle. Performance in Chrome is still excellent.

    4) I tried disabling WebGL for my app, but it won't launch on iOS at all due to the memory management that is lost (several layouts with large images that work totally fine when they are only loaded into RAM when that layout is active - which is what CJS 1.4 introduced, apparently leveraging WebGL to do it).

    Now that I understand more what's happening, it makes sense to me why all three statements above happened. So, at this point, I'm trying to figure out how to creatively work around the inherent performance hit of using WebGL and canvas together.

    Think it would be possible to only spawn a very small canvas object when the user touches the screen that follows the finger and somehow "paste" the trailing line to the screen?

    As a final note, I'm certain the glw error is not related to performance. I've been unable to figure out how to work around it, although I got lucky a few times and was able to exit out of the layout without getting the error, but I can't reliably reproduce that.

  • R0J0hound not sure if you can help with this, but I'm seeing this error when switching off of a layout that contains a canvas object. This is new since your update:

    Uncaught ReferenceError: glw is not defined

    localhost/c2canvas_plugin.js, line 248 (col undefined)

    I'll see if I can get around this by explicitly destroying the object or something, but thought I would share. Thanks!

  • SirSpunky How large is the canvas object in your app? I downloaded R0J0's updated from the link in the first post and I'm still seeing about 9 FPS on iOS. At this time my canvas object is about 50% of the screen. Got a solid 60 FPS prior to CJS 1.4 and WebGL.

    Btw, R0J0, thanks for the great plugin and for continuing work on it!

    Thanks!

  • I'm wondering if anyone else has been using the new official sprite font in their projects and noticed a significant difference in creation speed on iOS versus Android (via CocoonJS)?

    As an example, loading a layout that draws 40 words to the screen (each word being a separate instance of the sprite font) takes about 1.5 seconds on a Galaxy 2 10.1. The exact same operation takes 6 seconds on iPad 2. This is very surprising considering the iPad is faster than the Android tablet in pretty much every other way (even outside my app).

    Not surprisingly, the layout loads instantly on the PC.

    One more detail to include.. On CocoonJS 1.3, the creation speed was just as slow on the Galaxy tablet as it was on iPad. When 1.4 came out for Android, we saw a great improvement in sprite font creation speed and were excited to have iOS see the same improvement. Unfortunately, there was no change when we updated the iOS version to 1.4.

    I understand this may be a question for ludei, but I wanted to ask here as well.

    Thanks!

  • Would be awesome if I could set the Wrapping property to "none" for the new Sprite font object. Alternatively, (or additionally), it would be cool if the Character Width property as shown in the editor was actually called "Cell Width" and it could be referenced at runtime without having to specify a character in order to get width (the current character width implementation is useful as well, and I'm not suggesting it be removed).

    In a nutshell, I'm creating a drawText function of my own that I can use in all of my projects. What seems intuitive to me is to create the sprite font object, set the text, and then set the width of the object to Self.textWidth to keep things tidy. TextWidth returns the width of the wrapped text, not the width as if all characters were left to right, and I understand why this functionality makes sense. However, if I have a project where I never want text to wrap, it would be cool to be able to just set it at the object level and then TextWidth always returns the cumulative width of all characters.

    Now, assuming this is viewed as a low priority convenience request that can be worked around, I wanted to share a hurdle I encountered while trying to work around it :)

    When creating the sprite font object, I thought I could just set the width to len(string)*[cell width of the sf object]. This basically enforces the no-wrapping behavior, and then I can set text and trim down the width with TextWidth. However, it's not possible to grab the cell width at runtime, it is only possible to grab the width of a specific charater. My workaround to the workaround is to create an instance variable called cellWidth and set it manually when the object is created, using a hard coded value that I must remember to update if I ever change the sprite font image.

    Thanks for reading :)

  • Thanks for the replies!