Maskikng Questions

I have some questions regarding masking - even after I’ve read the Masking Guide.

1.  How do you handle Masking with orientation changes?  My first thought is to create 2 masks and via the orientation change event to manually place either a portrait or landscape mask - which leads me to my next question:

2.  How do I get the current orientation of the device.  I know I can retrieve it when it changes, but how do I know the initial orientation? and query its current orientation?

3.  How does the mask work with varing resolutions?  In my config.lua I have specified resolution of 360, 480 and I want the device to only work in landscape mode.  I have also added the imageSuffices for @2x = 1.5, and @4x = 3.0.  My goal is to mask a scrollView except for the bottom 80 pixels where I will have a toolbar and some buttons above that.  So, I created my mask at 364w x 404 h, where I added 4 extra pixels of black around my "native resolution and subtracted my 80 pixels for the rest of my UI.  There are 2 problems with this.  First becuase, I am working in landscape mode, the mask doesn’t automatically rotate.  I fixed this by recreating my mask in landscape 484w x 284h.  Now it is in the correction orientation, but no matter what the resolution of the simulator, it only covers 1/4 of the desired area.  Aha, so I thought I would just create the remaining masks (968 x 568 @2x, and 1936 x 1136 @4x), thinking that the system would grab the correct mask. This isn’t working.  The only way I can get this to work is to use my “@2x” mask directly via code.  So if I specify 360 x 480 why do I need a much larger mask for this wo work? and why doesn’t it pull in the “correct” mask based upon my imageSuffix entries in my config.lua.

Lots of questions I know, but I would appreciate any assistance.  Thanks!

Hi Brad!

You can retrieve the current orientation at any time using system.orientation although I’m assuming you are not using the Graphics 2.0 so the new mask concepts using containers does not apply. You may receive more answers in general discution group on how to use traditional masks using images.

Ivan. 

Hi Brad!

You can retrieve the current orientation at any time using system.orientation although I’m assuming you are not using the Graphics 2.0 so the new mask concepts using containers does not apply. You may receive more answers in general discution group on how to use traditional masks using images.

Ivan.