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 / Using renderToImage created a drawing app but there is a big problem

Author
Message
haliop_New
User Banned
Posted: 1st Mar 2019 17:19
I don't really know why this is happening and how to fix it I can think of some solutions but they may not work at all...


once I draw something and quit the app using the home button so I'm not closing it just moving to another app on my phone... when I come back it goes dark, everything is in a blackout .. also the sprites not only the actually render image...
what should I do?

maybe get is in the background and do something with it?
maybe save the image in a temp file once I move on to something else on my phone and when I'm coming back should I recreate everything and just paste that temp image?

this is a major bug I'm having, it will totally destroy my audience users... as they will remove the app, any suggestions?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 1st Mar 2019 21:48
Maybe you could use getresumed() to check if thee app has regained focus and refresh the display
haliop_New
User Banned
Posted: 3rd Mar 2019 05:15
yeah but then what?
do i need to reload all my assets?
maybe there is a fix just for renderToImage so then everything will be fine.. but it kinda messes up everything...
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 3rd Mar 2019 05:25 Edited at: 3rd Mar 2019 05:26
Are you using rendertoimage() every frame? Could you post some sample code?
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 3rd Mar 2019 12:25
Yeah, you need to share an example I think, rendering to an image stores it in memory, there's no reason it should delete. I assume you've set the image back to the sprite/object after resuming?
haliop_New
User Banned
Posted: 4th Mar 2019 15:40
Will post some photos when ill get home.
The idea of it is i use rendertoimage only on getpointerstate() = 1
So about 99 percent of the time when i move out of the app i don't use it...
haliop_New
User Banned
Posted: 4th Mar 2019 15:46
I also think that this might happen when the screen returns to portrait mode my app dose not allow portriat only landscape...
Cause in the second it moves to another app or the main screen the android calls onDestroy and render to image might get disfunctional ... But not only that not only the render to image quad is messed up everything is messed up.. buttons images sprites etc... The screen turns black i can see that the sprites are there but they are black like old DOS or something


Ill post a photo soon
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 4th Mar 2019 20:36
Quote: "The idea of it is i use rendertoimage only on getpointerstate() = 1"

Have you tried rendertoimage() when getpointerstate() = 1 or getresumed() = 1?
haliop_New
User Banned
Posted: 24th Mar 2019 07:54
I tried several things but nothing works... really... this is very confusing...
Paul, please help :/

has anyone encountered that?

I have several apps that will fail to succeed if this won't be fixed...
haliop_New
User Banned
Posted: 24th Mar 2019 09:25
ok, I have figured out what the problem is!
so its all about portrait mode and landscape...
since I locked it to landscape mode and it is the only one that can show... once I move out of the app and return it will automatically go black since the portrait is NOT available... but once you go out of the app it goes automatically to portrait cause these are phones these days.
so, because of the changing views and dimension, it goes into chaos... I have unlocked all modes and now it works, however, I do still want to lock it as Landscape, what should I do?
haliop_New
User Banned
Posted: 24th Mar 2019 09:32
oh my, I just thought of a quick fix

just check to see what mode it is on if the mode is landscape just make a cool animation to turn the phone back to landscape damn Israelis and their fixes D: jajajaja

(this fix is what is very known in Israeli Hi-Tech, sometimes the lowest end solution is the best. why? cause yeah obviously Paul and Rick should fix this but until they do I need to release my app... I can't wait... so, a quick fix with the current stage of the technology... )
(sometimes Apple uses the same ideology, a bug becomes a feature , now I need to think of the best animation! can someone think of a cool animation for it? I'll search on Shutterstock )
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 24th Mar 2019 10:34
Fairly sure mobile games have been doing that......em, forever. Lol.
haliop_New
User Banned
Posted: 24th Mar 2019 11:35
yeah, but I never thought AppGameKit would need that since the power of virtual resolutions... until fixed.
cause you know it makes it a bit harder I need to recreate everything with new coordinates and sizes...

RenderToImage and rotations should be fixed so we should not care about it.
It's kind of a new fix for AGK...
will post code later on once I'll get it done.

cause at this moment... it is working but everything is messed up since if I start at portrait the sizes of the buttons are miscalculated right...

so for now what I'm planning is, if you start the app at portrait it will not load anything or rather create any sprites and only once it is in the right angle only then it will create all the sprites and everything...
then if you go to portrait a new over the screen (depth 0) sprite will appear with animation to turn it again to left or right (90 or -90)

so it does take a bit of thinking with AppGameKit, on a normal Android app you just need to declare the layouts which can be a headache also .. so I'm figuring out the best possible solution or for say the most relevant.

code will follow soon maybe with the animation also
haliop_New
User Banned
Posted: 28th Mar 2019 08:23
ok, apparently this does not work every time...
once the rotation of the device is changed and sometimes its too fast to get to the function I wrote... everything is messed up again...

maybe it is just my phone but this means that some phones will crash the app ...

Paul? Rick? is there something I can do?
please help, this is extremely important as I move to India in a few months with my apps just thought like there are 1.5 billion people in India (just saying)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 28th Mar 2019 09:10
if you can isolate some code and post it i'd be happy to help
haliop_New
User Banned
Posted: 28th Mar 2019 13:13
honestly, I don't really know what to share...

it is a simple Quad Object and a Render To Image .

I only setRenderToImage when I press the pointer that is PointerState = 1
so if I'm switching to another app I do not draw to image at that instance... so its a simple render swap on the main screen buffer.

I changed the orientation allowed to accept all of the rotations available, 2 landscapes and 2 portraits. this actually seems to help cause I get the black screen of Thanos less, but it still happens.
I think I might have a phone malfunction but I am not sure if its that or AppGameKit 2.0+ problem.....

Login to post a reply

Server time is: 2024-11-23 01:46:05
Your offset time is: 2024-11-23 01:46:05