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() / ScreenToWorldX( ) / ScreenToWorldY( ) Buggs

Author
Message
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 10th Jun 2012 23:49 Edited at: 11th Jun 2012 00:07
SetScissor()
ScreenToWorldX( )
ScreenToWorldY( )

do these commands work ok on the newer versions of agk on mobile devices?
Iam still using 1074 because its the one that works on the goggle market player.
I noticed that they are completely off when working on apocalyp4 mode 7 engine.
Nead to know before i report them as buggs.

This works all ok on computer but completely buggs out on android because of these 3 commands


the screen to world command is used to get the rotation right on the kart.
set scissor command is used to render the track.

Iam posting here as i hope on an fast response
Its very crucial to test on mobile devices when testing.

Iam scrolling the track with set view offset that could mess things up with screen to world command on mobile devices?

Edited...........
Screen to world commands seamed to be a player fluke?
i held the phone in an angle the player thought where landscape when i started it?
Its pretty hard to develop when you dont know if its a player error or your code?
It seams to work every time now?
Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 11th Jun 2012 00:15 Edited at: 11th Jun 2012 01:09
My snake game uses setscissor to do the minimap and that works fine on android in both orientations using 1075.

Come to think of it, it also used the screentoworld commands to check the touch screen in the menus and that's ok too.

I never got that - why you need to use screen to world commands with GetSpriteHit to check sprites fixed to the screen

EDIT:

Here's a cap of SetScissor being used to create a funky rainbow effect - from my Android phone.

Attachments

Login to view attachments
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 11th Jun 2012 01:07
Quote: "My snake game uses setscissor to do the minimap and that works fine on android in both orientations using 1075."

Then should it work when the new player comes out

Hopefully is the set scissor command faster also?

The frame rate is only 26 fps since i added the kart in to the code on android?

Without the kart do i get 46 fps.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 11th Jun 2012 01:18
Sounds like an out of date player, hopefully the new version will be on the store soon.

I wouldn't expect a single new sprite to affect the frame rate that much, how did you add it?
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 11th Jun 2012 01:31
Quote: "I wouldn't expect a single new sprite to affect the frame rate that much, how did you add it? "


This works best with draw sprite!


If i show and hide the sprite so do i get lower framerate.
If i dont hide it before the large set scissor loop so do i get extremely low framerate.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 11th Jun 2012 01:45
What happens if you use the following code (untested)

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 11th Jun 2012 07:28
I will test it when i get home
Went to bed after posting last night
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 11th Jun 2012 17:38
Quote: "What happens if you use the following code (untested)"

This is pretty weird ?

I now get 190-204 fps on computer ( 0ld 314 fps )
Android gets 43 fps compared to the old 25-26 fps
This is better for mobile devices it seams?
So we will use that thanks paul
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 11th Jun 2012 18:10
If you add
after the final Sync command it will probably be faster on PC again.

My modified code does less drawing by using DrawSprite for the scissor loop and letting Sync do the drawing of the kart instead of drawing it separately.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 12th Jun 2012 01:29
Quote: "after the final Sync command it will probably be faster on PC again. "

No change for me ?

But it runs fast enough to add some extras

I added a low res renderer for slow phones instead .
All updates are in the showcase thread

Login to post a reply

Server time is: 2024-11-23 15:17:44
Your offset time is: 2024-11-23 15:17:44