OpenGL View using Cocos2d inside a Mac Desktop Application - xcode

I'm just getting started in development for a mac desktop app that will aid me in dealing with rigging a 2-D character in cocos2d.
The layout for what I'm working on is in the image here:
In the big grey rectangle to the right, I'd like to create an active cocos2d scene that I can interact with using the standard mac app GUI on the left. For example, when the user selects a file using the LOAD CHARACTER IMAGE... button, I want the scene to add the image as a CCSprite on the right. I want them to set the anchorPoint by clicking an anchor point button, and then clicking on the sprite, etc...
My Question is: How do I start implementing the scene within the window? How do I add the cocos2d framework to my project?
I'm fairly comfortable working strictly within cocos2d, but I need to get it to interact with a standard desktop GUI.
What steps do I take to get the scene in the window?
******EDIT******
I'm editing this to further clarify my questions that I need answered.
1. How do I add the cocos2d files to a project without using one of the templates?
2. How do I get a cocos2d scene to show up inside the grey rectangle of my .xib? (OpenGLView?)

Related

How to convert manual view controller to storyboard as a launch screen

New iOS requirements need Apps for iPhone or iPad must be built with the iOS 13 SDK or later and use an Xcode storyboard to provide the app’s launch screen.
But my project is very old and has never used Storyboards. All UI elements are created dynamically using ViewControllers.
I managed to create a storyboard file and set it as a launcher but it has no scenes and I do not know how to proceed. I would like to:
Create a scene where I place only the original launch image inside (hoping that apple still accepts this branding)
If it is possible to just connect my main ViewController with the scene (if that works with dynamical ViewControllers)
If nothing helps than I would need to create a simple scene which has just a bottom bar like my ViewController
I had this exact issue, here's what I did:
Create LaunchScreen.storyboard and set to use it as launch screen
Using the + button in the top-right (this was not an obvious step), add a View Controller into the storyboard
Untick "Use Safe Area Layout Guides" on the right panel if you're getting that error
Tick "Is Initial View Controller"
Then clean and run, for me it just worked. I did have trouble seeing it update though, as discussed here: Launch Screen storyboard not displaying image

How to create a global overlay for MacOS?

I am trying to develop a MacOS application using Xcode and Cocoa. My intent is to create an overlay on the user's screen that is mostly transparent, and does not register input. For example, an application like f.lux tints the colour of your entire screen like a global overlay, but you can still click on-screen items, as mouse clicks go right through (assuming that it's an overlay). How can I get started with achieving a similar overlay/widget?

Xamarin - how to center a launch screen image (iOS)?

I'm using Xamarin for Visual Studio, and am getting frustrated trying to do what I would think should be a very simple thing: creating a launch (splash) screen for iOS, that has a single image that is centered on the screen (vertically and horizontally centered).
I'm creating it the recommended way, using a storyboard (other methods, like using an assets catalog, are considered deprecated as of iOS 9). In the storyboard, I have a View Controller, which contains a View, which contains an Image View. In the Properties pane, I've tried messing with the Mode (in Widget tab), and I've tried playing around with contstraints - which I think might be the key, but it is difficult to understand how it all works together.
You need to add the Splash screen in the applications properties (Launch Images). You need to create the image and upload it via that section. I couldn't find anything saying that the use of Asset catalogues are depreciated.

How to create custom vector icons to use in Xcode application

I'm currently trying to figure out how I can make those glyph/vector icons appear like the default ones that you get with Xcode (e.g. NSActionTemplate). I researched and saw that they were saved in Illustrator to PDFs.
When I did the same trick (I managed to find the original Illustrator files for the icons by Apple) and saved it as an PDF, imported it into my project and dragged the icon onto a textured button it appeared plain black. It did however clear the white background so I thought it might be the white background that was visible in the preview that caused it to not style the button like the originals.
So basically what I'm asking is how I manage to make a icon appear like the default. I don't really wan't to make multiple files and/or code the behavior, since it should be quite easy to just drag and drop the image onto a button and apply the style itself.
-- EDIT --
OK, so I found the solution — By appending the text "Template" to the filename it will do this. But I still can't figure out why my transparent PDF - exported from Illustrator as AI and EPS - it still have a white background, which Xcode uses - so it will be a rectangular with the effect I want, instead of the circle.
Anyone that have an idea on how to remove the white background from the PDF so it will work in Xcode. It bugs me that it shows it is transparent (when seeing transparent grid in the PDF and Illustrator) and it still have a white background.
The white background in the PDF (and you should always use PDF over EPS—they "play nice" with OS X) has to do with the PDF format originally being oriented toward printed content. The white background you see in Preview and Xcode is the "page" area. Fortunately, this usually goes away / gets ignored when you load the PDF into an NSImage, as happens when you put it on a button.
If I'm understanding correctly, the problem you're having is you place a PDF with no background on a button, and in Xcode's Interface Builder it displays as if there were a background? I was able to reproduce this behavior, and I'm not sure what caused it. But I built and ran a test app with the very same Template file and errantly-displayed NIB. And in the actual, running Cocoa app, the graphic displayed correctly.
Sometimes Interface Builder just previews wrongly. I suspect the problem is merely cosmetic in preparing the interface.

How to animate an image in a Mac OSX application?

I want to set a basic animation for an image.ie when the application opens, an image to be shown in the window and after 1 second that image has to dissolve and show another. Can i do that using the transition filters in Xcode? If so, how? If not how can i implement that?
Thanks,
LS Developer

Resources