Another Director tweak needed for Android

In Director 1.2, you often use “display.contentWidth” and “display.contentHeight” for your transitions. This works fine on iOS devices. But on Android devices when using the zoomEven scaling, the display.contentWidth does not represent the visible width of the screen. You should be using display.visibileContentWidth instead.

What I did to fix this was to define some local constants at the top of the director.lua file:
[lua]local contentWidth = display.viewableContentWidth
local contentHeight = display.viewableContentHeight[/lua]
and then use these constants everywhere else in the file. I haven’t tested each transition, so it’s possible that some need some additional tweaking for this.

Also, I notice a lot of odd code for negating a value in director.lua. In some cases you do this:

[lua]0 - display.contentWidth[/lua]

and in other cases you do this

[lua]display.contentWidth*-1[/lua]

Not sure why you do either of these. Just doing:

[lua]-display.contentWidth[/lua]

works fine in Lua. More of a stylistic issue than anything else. [import]uid: 12529 topic_id: 7058 reply_id: 307058[/import]

Grr…still can’t edit posts.

In the first paragraph above, I meant:

“You should be using display.viewableContentWidth instead.” [import]uid: 12529 topic_id: 7058 reply_id: 24739[/import]