Comments (4)
Just found this it might be useful
http://developer.android.com/resources/articles/faster-screen-orientation-change.html
from monogame.
Use the following attribute to prevent the activity being recreated on an
orientation change.
[Activity(ConfigurationChanges=Orientation)]
This will then call Activity.OnConfigurationChanged when the orientation
changes. All other configuration changes will go through the standard
activity re-creation. It may also help to add Keyboard and KeyboardHidden
to prevent the activity being recreated when a keyboard is slid open or
shut. See the "Configuration Changes" section on this page
http://api.xamarin.com/index.aspx?link=T%3aAndroid.App.Activity
Sly
On 15 December 2011 05:32, Dean Ellis <
[email protected]
wrote:
There seems to be a big problem with the Orientation change stuff on
Android. After reading the documentation the Activity is re-created each
time the Orientation/Configuration changes. The means the Game object is
being re-created each time, so all the assets are loaded again and again
and again each time the orientation changes.We need to figure out a way to detect this and keep the same game object/
content manager around and just swap out the Activity/ AndroidGameView.This will not effect people who just use a fixed screen orientation for
games as the orientation will not change. however this might be the cause
of the Resume issue we have been seeing as well.
Reply to this email directly or view it on GitHub:
#170
from monogame.
Good find, ill give that a go today
On Dec 15, 2011 10:44 AM, "Steve 'Sly' Williams" <
[email protected]>
wrote:
Use the following attribute to prevent the activity being recreated on an
orientation change.[Activity(ConfigurationChanges=Orientation)]
This will then call Activity.OnConfigurationChanged when the orientation
changes. All other configuration changes will go through the standard
activity re-creation. It may also help to add Keyboard and KeyboardHidden
to prevent the activity being recreated when a keyboard is slid open or
shut. See the "Configuration Changes" section on this page
http://api.xamarin.com/index.aspx?link=T%3aAndroid.App.ActivitySly
On 15 December 2011 05:32, Dean Ellis <
[email protected]wrote:
There seems to be a big problem with the Orientation change stuff on
Android. After reading the documentation the Activity is re-created each
time the Orientation/Configuration changes. The means the Game object is
being re-created each time, so all the assets are loaded again and again
and again each time the orientation changes.We need to figure out a way to detect this and keep the same game object/
content manager around and just swap out the Activity/ AndroidGameView.This will not effect people who just use a fixed screen orientation for
games as the orientation will not change. however this might be the cause
of the Resume issue we have been seeing as well.
Reply to this email directly or view it on GitHub:
#170
Reply to this email directly or view it on GitHub:
#170 (comment)
from monogame.
that seems to work, but we now have to update the Viewport manually with the new width and height because the game is not being re-created each time. Looking at sorting that out now.
from monogame.
Related Issues (20)
- Repair WindowsDX tests HOT 4
- Empty Queue Crash in DynamicSoundEffectInstance.PlatformUpdateQueue() HOT 6
- TestFailure: TestMergePositionsMultipleGeometries - Index was outside the bounds of the array. HOT 1
- MGCB editor fails with a parsing error in latest "develop" HOT 5
- Feature Request: Resolve Missing XML For Public Type Warnings HOT 4
- unmanaged callers only HOT 4
- Project Template Type Table Documentation URLs need to be updated HOT 2
- [PAID BOUNTY] [LOCKED] Switch the console runtime from BRUTE to NativeAOT HOT 4
- [PAID BOUNTY] [LOCKED] Implement the Direct3D 12 / GDK/GDKX backend HOT 1
- NoSuitableGraphicsDeviceException on Virtual Machine HOT 2
- PathHelper.GetRelativePath potential bugs HOT 2
- Issue with GetData/SetData as of 2024 HOT 1
- `DrawableGameComponent.Initialize` Does Not Behave How XNA Documentation Describe It HOT 1
- [PAID BOUNTY] [LOCKED] Package up ffmpeg and ffprobe HOT 10
- [PAID BOUNTY][LOCKED] A shared base for public and console repos
- AL lib throws unclosed device warning on proper game exit HOT 4
- Variable rate shading HOT 2
- [Urgent security issue] FreeImage arbitrary code execution vulnerability HOT 2
- tu-clausthal link does not exists HOT 2
- Getting started page is not working HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monogame.