Comments (9)
sounds like a problem in MonoGame. We'll take a look over there. Did you base this on PR1612 from monoGame or directly from Nezz's working branch?
from cocos2d-xna.
From Nezz's working branch. Also, the resume is not working well. After resuming, there is a black screen.
from cocos2d-xna.
Once Nezz's changes are merged into the main repository then we can address the issues more readily. Resume is an ongoing struggle as the textures must be rebuilt and that is the function of the content manager. We attempt to reconstruct labels after they are disposed during the resume, but if we don't get the proper event firing, then there's no way for us to know the labels need to be reconstructed. MonoGame PR1805 is the update of Nezz's changes. That PR should get merged soon. Then Nezz has one more change to submit.
from cocos2d-xna.
Maybe you right, but when I tested MonoGame standalone - everything works fine. As soon as I doing the same with Cocos-Xna - there i a problem with resuming.
from cocos2d-xna.
Hi, some update: I think you are right, this resuming problem related to MonoGame only. If I creating Texture2D via content manager - it works fine. However, if i initializing Texture2D myself (via "SetData") - it not resuming. I assume you doing some kind of registration for device reset during reading xnb file. So, now I looking for it, in order to do the same for my created textures.
Another issue (I just don't know where the right place to ask): when I displaying textures via Cocos-XNA, they look as scaled. I would like to remain the original size of images. How I disabling this scaling? Thank you
from cocos2d-xna.
When you design the textures of your game you do it at the design resolution. For instance, if you target a 1024 x 768 device, then make your game fit into that resolution at scale=1. Then when you set the resolution target, all of your textures will scale appropriately (when you set to fit contents). If you set to the resolution policy to ExactFit then your game will letter box.
from cocos2d-xna.
About recording for reset - I found it. Indeed, it is in the content manager. On device reset, you go over all the loaded assets and reloading them. My 2 cents - in this approach, you making assumption that textures created only via content manager. At least in my case, that is not the case. Since (currently) in WP version Texture.FromStream is not implemented, and I need to load textures from IsolatedStorage - I had to do it myself, without ContentManager. Maybe it is better that every graphical asset will subscribe for "DeviceReset" event and then it will reset itself.
About scaling: in my game, I doing reuse between graphical assets (between WXGA and 720P resolutions). The graphics designed in special way, that I can clip its borders on narrow resolution - and it still will look fine. So, I need to keep my images in original size without any scaling (e.g. in 720P its borders should be out of screen). How do I set this behavior?
Thanks
from cocos2d-xna.
See the modes in ResolutionPolicy. There is an option to not do any adjustments.
as for the texture reloading problem we have the same issue with CCLabelXX in cocos2d. We attempt to handle this automatically by caching the ctor parameters and then replay the ctor when the texture is disposed. This mostly works. In your game you should get a LoadContent() call when the textures are reloaded. In that call is where you should rebuild your content.
This is a very common programming pattern in mobile games. We can only reconstruct textures when we have the original source data. In your case, the stream is not able to be cached because it is a non-random-access stream. Sorry.
from cocos2d-xna.
Marking this as closed.
from cocos2d-xna.
Related Issues (20)
- Refactor source base to use CCPoint instead of CCPointExtension HOT 1
- Refactor CCPointExtension - Implement all missing methods in CCPoint that exist in CCPointExtension HOT 1
- Continuous Build System WinRT, Windows HOT 1
- Continuous Build System MacOS
- Continuous Build System iOS, Android HOT 1
- CCProgressTimer renders incorrectly HOT 4
- Create Docs for Cocos2D-XNA HOT 1
- Add support for CCLabel which uses System Fonts instead of Font XNB Content HOT 2
- Add loading of TTF font files in iOS and Mac HOT 1
- Simplify adding and generating assets to Cocos2D - Visual Studio HOT 1
- Simplify adding and generating assets to Cocos2D - Xamarin Studio Windows
- Simplify adding and generating assets to Cocos2D - Xamarin Studio Mac
- GameStarterKit.iOS doesn't build - missing CCEvent HOT 1
- Some TTF files, ex Abberancy.tff, are not displaying correctly
- Add support for CCLabel which uses System Fonts instead of Font XNB Content - Windows 8 and WP8 HOT 1
- Add Input handling to CCNode so that all inherited classes can receive input
- Accellerometer support not working HOT 1
- Please exclude LibTiff from Cocos2d WinRT project HOT 2
- Add support for CCLabel which uses System Fonts instead of Font XNB Content - WP8
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 cocos2d-xna.