Coder Social home page Coder Social logo

Comments (9)

totallyeviljake avatar totallyeviljake commented on August 11, 2024

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.

motek80 avatar motek80 commented on August 11, 2024

From Nezz's working branch. Also, the resume is not working well. After resuming, there is a black screen.

from cocos2d-xna.

totallyeviljake avatar totallyeviljake commented on August 11, 2024

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.

motek80 avatar motek80 commented on August 11, 2024

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.

motek80 avatar motek80 commented on August 11, 2024

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.

totallyeviljake avatar totallyeviljake commented on August 11, 2024

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.

motek80 avatar motek80 commented on August 11, 2024

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.

totallyeviljake avatar totallyeviljake commented on August 11, 2024

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.

kjpou1 avatar kjpou1 commented on August 11, 2024

Marking this as closed.

from cocos2d-xna.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.