Touchpad with createscreen

Previous topic - Next topic

Crivens

Ok so my main game routine uses 3D with nothing fancy.

Once I get to the high scores section I do a bit of coding that involves using createscreen/usescreen.

This all works perfectly on every device I have (iPod2/iPod4/3GS/Pre2/PC and probably Android if it wasn't totally out of battery) except the Touchpad.

The TP runs the game with no problems, but when it gets to the createscreen section it turns the screen landscape. The game normally runs in portrait and I have no orientation code whatsoever.

Interestingly if I comment out the createscreen/usescreen lines (no other lines whatsoever) then it will stay in portrait and not enter landscape view. I just double checked and it's when it uses USESCREEN for the created screen. If I use createscreen but never use usescreen then it stays in portrait.

Also interestingly I note that even though my app is in portrait (again I don't ever set the orientation in code, only with project options with 9998x9999) when I quit it, at any point (including the main game that works in portrait) then the whole of the TP is in landscape mode for a second. Bit naff, plus it it's lying down on the table then it stays in landscape mode. Can it not remember to reset the orientation on a TP when it quits? Possibly will do it myself but it's a bit weird considering the app thought it was in portrait anyway.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Ian Price

#1
I've used CREATESCREEN and USESCREEN on TP with no obvious problems. My current game (WordSearch) uses both - although it is in landscape mode throughout.

I'll do a quick test myself now.

[EDIT]
Other than being upside down (without SETORIENTATION 3) it's fine.

Code (glbasic) Select

CREATESCREEN 1,999,300,300

USESCREEN 1

DRAWRECT 0,0,300,300,RGB(255,0,0)

PRINT "THIS SHOULD BE CORRECT IN PORTRAIT MODE",20,20

USESCREEN -1

SETORIENTATION 3

WHILE TRUE

FOR n=0 TO 100
DRAWRECT RND(768),RND(1024),RND(64),RND(64),RGB(RND(255),RND(255),RND(255))
NEXT

DRAWSPRITE 999,200,300

SHOWSCREEN

WEND



[attachment deleted by admin]
I came. I saw. I played.

Crivens

That's the thing. I never use setorientation and it is in portrait. I assume because of the 9998x9999 project options. But as soon as it sees usescreen it goes into landscape. Interestingly the createscreen is more of a landscape orientation.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Ian Price

Maybe it's down to your setting the screen size so high. Dunno. Why use such high values on a machine that can only go upto 1024x1024 anyway?
I came. I saw. I played.

Crivens

For universal apps. Using this then it will always use the default res of the device. It still knows it is 768x1024. My createscreen is half the width and a third the height of the screen if I remember rightly but everything is turned landscape not just the created screen.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Ian Price

Well I don't know what's causing your problem but under normal circumstances it's working fine, as the example above shows.

Dunno.
I came. I saw. I played.

Crivens

 I'll try setting an exact resolution in project settings. And then try to make a simple project to test.

Is seriously annoying as it is just the TP.

Does your TP exit a portrait app and the OS is in landscape mode? Mine does that all the time. Even before this bug.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Ian Price

TP apps do appear to rotate before they exit completely, can't say that it bothers me though. And yes, it's always done that.
I came. I saw. I played.

Crivens

I know they have. But even though I don't care that much it makes it look a little naff. Especially when it doesn't orientate itself if flat on a desk...

Excellent my new laptop turned up (old one falling apart). Now when I get a chance I will see if I can get a simple project going to replicate this problem.

Plus the only devices I can test at TP resolutions are PCs. I think I may install Android onto the TP when I get a chance so I can see if it happens there too (my cheapo Android tablet is a little wonky and nowadays (never used to) seems to want to do everything in landscape for GLB...).

Cheers 
Current fave quote: Cause you like musicians and I like people with boobs.

Ian Price

Re: rotation on exiting an app. This is NOT a GLBasic bug; other apps do it too - check out Angry Birds HD. It's just one of those things, until HP fixes it.
I came. I saw. I played.

Crivens

Ah ok haven't noticed. Although doesn't Angry birds play in Landscape so you can forgive it that one. My app is portrait and it exits landscaped.

*Definite* bug though for GLB in my game. Well weird. Hopefully this weekend I can get a demo project showing the problem although Xmas is right eating into my spare time...

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Kitty Hello

I think i fiund a way to read and set the screen orientation w/o breaking compatibility with older webos versions. I'll try in some weekend.

Crivens

Ooh cool. Do you think this is also what is happening with my bug? If not then I should have time later to knock up a test project.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Crivens

Ok this is weird. I just got my new laptop all setup for GLB development. I changed some code to use a different method of clearing the created screen, and now it works fine on the TP.

The only difference is obviously this is a new laptop. The old one couldn't even use create/usescreen. Nothing would happen. But it was an old machine. And compiling onto the Pre2 worked perfectly. But the TP had the noted bug.

The other difference is that the new code used DRAWRECT to blank out the created screen. Before this I simply used CREATESCREEN again (with the same ID and spriteID) which worked on everything apart from my new laptops Nvidia card (if I choose it over the Intel HD 3000 graphics which is normally automatically selected by Omptimus or whatever it's called).

Anyway, now it is not doing several identical CREATESCREEN commands then it works fine on everything, including the TP....

That's fine with me! Lesson learned! Don't know why I didn't use DRAWRECT in the first place. Still, a good idea to just check the GLB TP code for CREATESCREEN if used more than once (identical command). Note it only went wrong before when it used the USESCREEN command.

Now to power on and get the damn app out the door! Have you ever noticed that something you *loved* at one point, even when loved by everyone who sees it, can get really damn annoying in the final stages. Stupid fancy high score table. Knew I should have done something simpler...

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

ampos

Have you try if to clear the screen is faster drawrect or polysprite?