Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
TheDarkIn1978
Posts: 409
Registered: ‎12-10-2010
My Device: PlayBook
My Carrier: N/A
Accepted Solution

Crazy Rendering in PlayBook Simulator.

[ Edited ]

i'm having a major WTF moment.

 

on the brink of completing my application, i've loaded it in the new 0.9.4 simulator only to realize that portions of the application's graphics are being rendered incorrectly.  child coordinates are way off and certainly don't exhibit the same behavior while testing in ADL.

 

the only additional library i'm using besides pure AS3 classes is Tweener.  i'm not even using QNX.

 

the object below is a Sprite that has a square shape graphic, texture bitmap with a "multiply" blend mode and a mask for the bitmap texture that is aligned with the square graphic.  even though the texture is scaled down to be the same size as the square shape, there was often a sliver of excess bitmap - hence the mask, which works just fine.

 

anyway, the object also has a drop shadow that also tweens while the object's z position changes - when the object is selected it raises from the background canvas creating a 3D space.

 

in ADL, the object is added to the canvas by dropping straight down along the z-axis (dropping away from the viewer), becoming smaller and landing on the canvas.  however, in the simulator, the object drops down from the bottom right corner of the screen.  ??!!

 

what could be causing this?  why is the difference between ADL and the Simulator so great?  could something so buggy be just the simulator or should i expect the same thing on the actual device?

 

PBSimWTF.jpg

 

 


PlayBook Applications:
Drop Swatch
Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Crazy Rendering in PlayBook Simulator.

hey darkin,

 

thats a really strange happening esp since u arent using QNX stuff (i've ran into measurement problems in the past with those). What is the meta data for your project? is the following:

 

 

[SWF(width="1024",height="600",frameRate="30",backgroundColor="#CCCCCC")]

 

maybe there is problem with the sizing of the stage. lemme know good luck!

 

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.
Developer
TheDarkIn1978
Posts: 409
Registered: ‎12-10-2010
My Device: PlayBook
My Carrier: N/A

Re: Crazy Rendering in PlayBook Simulator.

yes, my metadata tag is set:

 

 

[SWF(width="1024", height="600", frameRate="60", backgroundColor="#000000")]

 

although i plan on removing it and relying on the following for portability:

 

 

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;

both were set during simulator debugging.

 

if i recall correctly, i didn't have this problem with 0.9.3 simulator.  when adding a new object to the stage, i'm setting the object's scaleX and scaleY properties to 1.5, and then tweening those properties back down to 1.0 while also tweening the drop shadow.

 

i don't belive i'm doing anything particularly groundbreaking or experimental here.  fingers crossed that it's an issue with the simulator, but if that's the case i assume my application will join others' on here in gathering a nice coat of dust before it's accepted and posted to App World.

 


PlayBook Applications:
Drop Swatch
Please use plain text.
Developer
TheDarkIn1978
Posts: 409
Registered: ‎12-10-2010
My Device: PlayBook
My Carrier: N/A

Re: Crazy Rendering in PlayBook Simulator.

another possible clue / problem is my splash screen.  it's simply an all black .jpg sized at 1024 x 600 pixels @ 72 PPI.  when the app is launching the splash screen doesn't cover the screen as evident in the image below:

 

splashscreen.jpg


PlayBook Applications:
Drop Swatch
Please use plain text.
Developer
Brandon_Appetizer
Posts: 146
Registered: ‎03-27-2011
My Device: Blackberry Playbook
My Carrier: WiFi

Re: Crazy Rendering in PlayBook Simulator.

I just posted this on your other post and thought it could be related to this issue. In any case, it's something to try...

I have a hunch that the simulator isn't loading your jpeg properly, possibly because it's interlaced or has another odd setting. So, one part of the simulator thinks it's dimensions are different from what they really are. Try saving it ad a .png image and see if your problem is fixed.
----------------------------------------
If this post solved your problem, please click the 'Accept as Solution' button.
If you found this post useful, please provide a Kudo. Thanks.

Approved Apps: Celestial Slingshot
Please use plain text.
Developer
TheDarkIn1978
Posts: 409
Registered: ‎12-10-2010
My Device: PlayBook
My Carrier: N/A

Re: Crazy Rendering in PlayBook Simulator.

[ Edited ]

it was the first thing i tried after learning from your solution about the interlaced .jpg causing my splash screen to stretch.  i converted and resaved all of my .jpg texture assets as .png, recompiled, but unfortunately the problem remains in the simulator.

 

i wonder if something so buggy in the simulator will also be present into the actual device?  

 

 


PlayBook Applications:
Drop Swatch
Please use plain text.
Developer
TheDarkIn1978
Posts: 409
Registered: ‎12-10-2010
My Device: PlayBook
My Carrier: N/A

Re: Crazy Rendering in PlayBook Simulator.

[ Edited ]

problem solved, generally.

 

this was causing the error:

 

 

try                {newSwatch.cacheAsBitmapMatrix = new Matrix();}
catch(error:Error) {}
finally            {newSwatch.cacheAsBitmap = true;}

 

 

cacheAsBitmapMatrix is only supported on mobile devices and my application code base also targets desktop – hence the try/catch block.  it seems as if the simulator has an identity crisis and can't determine if it supports this functionality.  i assume the simulator thinks it can, but in the end it just can not.

 

oh, PlayBook Simulator – The Little Simulator That Could (n't).  "i think i can!  i think i can!"

 

now the question:  should i include this as part of my submission or comment out the lines of code?  when submitting is there a place to write special instructions for testers?

 

i'm asking because i'm quite confidant that that cacheAsBitmapMatrix will work on the device itself, and since it makes my program faster i'd rather include it rather than resubmitting at a later date.


PlayBook Applications:
Drop Swatch
Please use plain text.
Developer
turtle-dev
Posts: 91
Registered: ‎01-26-2011
My Device: Torch
My Carrier: ---

Re: Crazy Rendering in PlayBook Simulator.

Perhaps you can write instructions in the Release Notes during the upload process.

~~~~~~~~~~~~~~~~~~~~
My PlayBook Apps
Please use plain text.
Developer
Brandon_Appetizer
Posts: 146
Registered: ‎03-27-2011
My Device: Blackberry Playbook
My Carrier: WiFi

Re: Crazy Rendering in PlayBook Simulator.

I personally wouldn't risk it and (unless it becomes unusable), would rather submit a 'slower' version followed by an optimized version when you can test on actual hardware.
----------------------------------------
If this post solved your problem, please click the 'Accept as Solution' button.
If you found this post useful, please provide a Kudo. Thanks.

Approved Apps: Celestial Slingshot
Please use plain text.