I am very new to MvvmCross.
To use Mvx.MvxBindableListView in my android Acivity, My activity should be inherited from
which class ,whether from MvxActivity or other class ?
You are correct, your activity needs to inherit from MvxActivity. If you want to learn more about MvvmCross, I highly recommend watching N+1 series of videos http://mvvmcross.blogspot.com/
Related
I have a main class in which 3 other class objects are managed and instantiated and are all extended from Sprite. My issue is getting these loaded correctly as I have external assets(images,and sounds) being loaded into these 3 classes. I have a simple .fla that is referencing the "Main". How would I go about ensuring the appropriate class instance is being loaded properly before it is added to the stage?
I have tried making the three classes inherit from the Loader class to retrieve the bytesloaded/total for the class but this causes other issues in the code that require attributes from Sprite. Would I need to preload ALL assets inside the class first, thus making the instantiated object on "Main" preloaded? Thank you for any help/advice.
Thank you all very much for your help. This particular application was being deployed in a learning management system. The issue was the application its self was freezing due to a .js script used for SCORM communication. However, it was very useful for me to learn how flash is managing instantiation, I really appreciate the help both of you provided.
Does smb knows how to pass a context to InterstitialAd in LibGDX?
In Android it is simply
InterstitialAd interstitial = new InterstitialAd(this);
My class extended from Screen. or I can intialize it in class extended Game.. Or how to pass the context in this case?
And if smb knows any problem related to this, I'll be very thankfull to any advice!
To show ads from inside other classes not from the main activity you need to use a facade. Basically, you make use of a listener to load/display the ads.
Follow this libgdx official tutorial guide. It covers both banner and interstitial ads and it isn't outdated. It uses the new admob via the google play services
In the original Box2D API, the WeldJointDef class has two Attributes that I couldn't find in the LibGdx gdx.physics.box2d.joint.WeldJointDef class which are:
- frequencyHz.
- DampingRatio.
modifying these two attributes give more flexibility to the joint.
Is there any way to access these attributes ?
LibGdx gdx.physics.box2d.joints.WeldJointDef
These features have been added to the LibGdx API.
hi i am developing a game using libgdx. I want to make the texture object available to entire application. I have a requirement like, initialize the texture in one application listener and i want to use it in another application listener. Can anyone help me on this.
There are two ways I think you can do this. First, you could read the data into a static variable. For an example of this, take a look at the Art class in metagun demo: Art.java. The second way, which I have not tried yet, is to use the new AssetManager class. There is example use in the AssetManager test. These should help you access your textures more easily.
You don't need to have 2 or more Application listeners. Actually that only makes things harder.
Use Screens instead (extending Game in your core class instead of directly implementing ApplicationListener).
Either way, you should be able to just send the textures as arguments. For example I have a class Assets that contains all the textures and I sent it to each screen. You can make them static as Doran suggested too.
I'm building a flash app (just AS3 with FlashDevelop) and I'm having some trouble keeping things loosely coupled around the event system. I've done a lot of reading about central event systems and static eventdispatchers but they don't quite fit the bill for me.
What I'm building is similar to a video player. I have a Player class which is the parent of all the other little parts of the app. The Player class extends Sprite and I've currently designed it so that you could instantiate multiple Player's and put them on the stage. I also have a Controller class which extends EventDispatcher and I dispatch all my events through this class. It's a central event class.
The problem is that I need to pass around a reference to this class so that all the other classes can dispatch and listen through it. Passing around the reference works but it's the exact opposite of loose coupling. I know I could make a static EventDispatcher that all the classes could see but then if I had two or three Player's on the stage they would all hear each others events.
How can I create a type of sandbox that will allow all the child classes of a Player instance to be aware of the central dispatcher without passing a reference or making it static?
I'd suggest to use my static dispatcher, this one has an ID mechanism that allows to tell which Player instance dispatches an event.
It turns out what I was really trying to understand was loose-coupling using something like dependency injection.
I never ended up doing this in any AS3 projects as I don't do much of it anyway. Having done more C# recently I more easily grasped this concept using libraries such as StructureMap and Ninject.
For AS3 you could use a framework like Robotlegs. This will probably change the way you code AS3 and may not be for all developers/situations.