Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / SetScissor Issues

Author
Message
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 23rd Apr 2015 16:07
I am using the following code to attempt to get a sprite to fill the whole screen:



No matter what device (Android and Windows) this code is run on, there is always a black bar on the right hand side. All GetScreenBoundsRight() seems to return is the VirtualWidth plus the GetScreenBoundsLeft() offset. Should this not return the full width of the device?

Also, Setscissor seems to be ignored if the app has to change orientation. If the above code is started in landscape mode (the intended orientation) the Setscissor command works fine. If I start the app in portrait mode, Setscissor is ignored.

Is this a bug?

CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 23rd Apr 2015 16:25 Edited at: 23rd Apr 2015 16:27
Try:



I have added the 'left' and 'top' gaps to the size of the sprite.

V2 T1 (Mostly)
Uzmadesign
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 23rd Apr 2015 16:36
Hi CJB, and thank you for the help and quick response. It is very much appreciated.

Your code works well, and I must admit, that was my first thought on getting this working. Is this how the command should be used though? I am curious if there is an issue with this command, since I have never used it prior to 2.0.13. Also, if the app is started in portrait, and flips to landscape as per the SetOrientationAllowed (0,0,1,1) command, SetScissor still seems to be ignored.

CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 23rd Apr 2015 18:14
You're right. When you start in portrait, it flips round (due to setorientationallowed(0,0,1,1)), but the edges get stripped off again.

I had a similar issue (thread) that was resolved by adding a virtual resolution, but this is clearly not the fix required here. Hopefully Paul will come to the rescue! - Although it does appear as though something fundamental has gone a bit awry with changing orientation with this build.

V2 T1 (Mostly)
Uzmadesign
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 23rd Apr 2015 18:46
Adding a Sync after SetVirtualResolution fixes it, this only affects the player because it could be in portrait mode when your app starts so it needs time to rotate. If you were to export an APK with landscape set in the export settings then the app will always be in landscape mode at the beginning of the app and this won't be a problem
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 23rd Apr 2015 19:03
Many thanks for all the help everyone. I used an alternative way of doing things in the end, but I will remember this for future use

Login to post a reply

Server time is: 2024-11-25 21:59:44
Your offset time is: 2024-11-25 21:59:44