Cocos2d with view controller - uikit

I am new in cocos2d game and want to develop a game related to slingshot like angry birds.
I have a single view based application and I want to use slingshot logic in my view based app like in angry birds.
Can anyone please help me how I can do that?
How I can use uikit and cocos 2d together?

By default, any cocos2d app begins from creating main view controller, then creating OpenGL view. Just create any cocos project from templates and you will see it. Any cocos2d app is one-view app. It's view is OpenGL view.
http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:lesson_1._install_test
install xcode templates as described here, then just create simple application from cocos2d template, there you can find an example of creation simple cocos2d app

Related

How do you mix Xamarin.Forms with Xamarin.Native using MvvmCross?

According to MvvmCross 5.3 documentation you can mix Xamarin.Forms and Xamarin.Native:
"With MvvmCross 5.3, you will now be able to mix and match Native Xamarin views with Xamarin.Forms pages using ViewModel navigation!"
My scenario is the solution contains Xamarin.Android and Xamarin.iOS projects which rely quite heavily on MvvmCross. Going forward I would like to be able to create new views/pages using Xamarin.Forms. I'm assuming this is what is meant by "mix and match".
Other than the above statement I can't find any documentation or examples on how to do this.
I tried extending the MvvmCross TipCal app to show a new Xamarin.Forms view/page without any luck.
Can someone explain or provide an example of how to mix and match Xamarin.Forms with Native Xamarin using MvvmCross?
I think if you truly want to mix forms/native you need to either create a custom view presenter or trick the existing view presenter to "embed" a forms page into a viewcontroller/fragment/activity.
I have created a helper library as a proof of concept to embed Xamarin.Forms content pages into fragments/activities/viewControllers but could use some help ironing out some bugs with Android. It seems to work fine for iOS.
Let's take iOS as an example.
This approach has you create you content page as normal, but also create a wrapper viewController. You embed the content page in the viewController and when you navigate, you navigate to the viewController wrapper instead of the content page.
https://github.com/dornerworks/Mvx.Forms.PageWrapper.iOS
https://github.com/dornerworks/Mvx.Forms.PageWrapper.Android

Add Monogame View to Xamarin Storyboard for iOS

I'm very used to working with Monogame but am just getting started in Xamarin. I have created a Xamarion iOS project with a storyboard (seen in picture). This works and I have created Segues and web service calls and what not that work great.
Now to the question.
How do I add a Monogame view to this?
Ideally I would like to add a Monogame view to the same storyboard that I can just switch to like I do all the Views. I have however not been able to find any guides or hints on how to do this. The guides I have found so far either speak of storyboards or a Monogame app, not how to use them together.
Update: Any answer that shows how to start a Monogame instance while in the regular storyboard mode programatically and exit back into the storyboard menues is acceptable. It does not have to be a subview, I'm fine with if it takes the whole screen.
It's hard to answer this question in a better way than this stackoverflow answer ... but to summarize, you probably want to let MonoGame "run" the application for you, and when you want to use UIKit, you'd basically either push a custom controller onto the stack, or show a new UIView on top of the existing monogame screen.
Sadly, you will have to modify how MonoGame works if you want to show your MonoGame game after a UIKit controller.

Xamarin - mixing Forms and Storyboards

Is it possible to mix iOS Storyboards and Xamarin Forms within one application? I have a bunch of views that are easier to be created in Forms, but some which are heavily customized so we would need to create some of them in native code.
I would like to use Storyboards to create the native parts, but can't seem to find a way to navigate from a Forms page to a Storyboard and vice versa.
I don't mind doing it from code, just need to know the direction to look into and if it's even possible.
You can create native views using the concept of Custom Renderers (see links below). The idea is that you create a Xamarin Forms Control that's shared between all platforms and which old common properties (like colors, general data etc), and do the native rendering on the iOS/Android/WP projects.
So, for your storyboard, you can create it usign Xamarin.iOS, and render using a Custom Renderer. The link posted by #GSerg in the comments have some information and examples, but you can take a closer look at the oficial documentation as well:
Introduction to Custom Renderers
Customizing Controls on Each Platform
Customizing Control Rendering in Xamarin.Forms (video)
Also, for more real world examples you can take a look at the Xamarin Forms XLabs project.
Thanks to Rafael Steil's answer. I looked at the links and a few more samples.
Notably:
Custom Renderer Map
Using Xamarin Forms alongside Storyboard
And I created a sample project to show the back-and-forth navigation between Xamarin Forms and pages created in Storyboards. You can find it over here:
Xamarin Forms Mixed with Native

Create shared UI in a different scene with Unity3D

I come from an iOS/OS X background and now use Unity3D a lot.
I would like to know if there is a way to create a UI in a separate scene in Unity and include that UI in multiple other scenes? Much like loading the same view from a xib in Xcode.
Turns out there are quite a few ways to do this (see comments on question).
Prefabs
DontDestroyOnLoad
SceneManager additive loading (my choice).

Can I hardcode my StoryBoard?

I'm new to iOS developing and xCode from WPF C# (where I almost never drag and drop but hard code my "view"). In xCode 4.2, does all the view in MVC contains in the MainStoryBoard.storyboard? Can I hardcode my view (or, can I hardcode my storyboard or view its source code)?
You can create an entire app without touching interface builder or storyboards. But I'd strongly recommend actually using them instead - if you're writing an iOS app, write an iOS app, don't try and crowbar in practices from a different framework.

Resources