Swift Outlined SKLabelNodes - swift

I am making a game with SpriteKit's framework. How would I make an outlined text with SKLabelNodes? There doesn't seem to be a built in function of doing this. If there is no way to do it within SpriteKit, what other ways could I approach this?

Ok, so I didn't know how to implement UILabels or NSAttributedLabelNodes onto a SpriteKit GameScene, so I just put 4 SKLabels in black behind the original SKLabel (same font size). I then adjusted the 4 black SKLabels, one going a little to the left (relative to the original label), a little to the right, a little up, a little down. This gave an outlining illusion. Pretty bootleg solution but it works. Hopefully SpriteKit implements a better built in option!
Hope this helps someone!

Related

Swift Slamming Logo Animation

I am creating an application in Swift, and I would like to make an introduction screen that shows off my logo. I want the logo to slam down on the screen, which will then cause a crack, and then that crack slowly grows. I think I can figure out slamming the logo down (by shrinking a UIView of my logo to a certain point), but I am having trouble deciding how to create the crack that will form from slapping down. Do I use views? I am lost.
This is the closest thing that I found to what I would like to do. Sadly, I do not have this software.
https://www.youtube.com/watch?v=bh2y0Xs4IWA
I have created a similar effect before. And to achieve the crack a created multiple images of a growing crack and created an array of images for that screen crack. All you have to do then is animate the images if the imageView.
The other way you can Handel this is to actually draw the crack your self by code which is not difficult really, because in reality it’s just lines and then animate them. But in my experience just using the first method gives a much nicer effect because the images you use can have tons of effects using PS or equivalent.
I would suggest to go with third party like lottie. In lottie files there some animation you except there, you can also message the designer to help out animation. Its very simple to use in swift.
https://www.lottiefiles.com/
you can also check out my profile:
https://www.lottiefiles.com/parameshvadivel
Lottie animation are done in aftereffects using bodymoving extension and exported as json file to use in xcode.

Unity 5.5 layers

I have a question regarding panels/layers in Unity.
My problem is that sprite which i set to be in the lowest layer, overlaps other panels which are set to be in higher levels. Is there any way to fix it? I tried almost everything and still my sprite is always overlaping layers which are above it.
in the next picture you can see settings of the layers.
I would really appreciate a help. Thanks a lot
You Can just re-order them in the Hierarchy window. top to bottom. Bottom most is above everything else.
There are other posts on this subject you can check. But you need to use transform SetAsFirstSibling, SetAsLastSibling, SetSiblingIndex, GetSiblingIndex
Please take a look at this

UITableViewCell Background stretching

I have a problem in Swift with UITableViewCell background image. Let's say that it shows quite fine one iPhone5 but on iPhone 6Plus it is stretch and thus it looks bad. This is probably due to Aspect fill or something which I really couldn't manage to change and achieve what I want so would be the best if someone could poke sample code I am providing as well as image how it should look, so anyone can check it out and maybe give me some hint or tip or sample code or even fixed demo version.
So here it is:
Note that on left side there is a curve (like half a circle) around right side of icon. On bigger phones or tablet, that curve gets super stretch thus completely destroying the look.
Demo code link
Thanks all in advance for any help. I am pretty stuck with this one.
You can stretch an image while preserving the aspect ratio of a portion of that image using slicing. Xcode offers a graphical interface for doing this. The idea is that you decide what parts of the image are allowed to stretch and which aren't.
https://developer.apple.com/library/ios/recipes/xcode_help-image_catalog-1.0/chapters/SlicinganImage.html

Drawing tiles using UIImage or use buttons?

I'm new to IOS development, and want to create something with tiles similar to what you see here. http://www.youtube.com/watch?v=i7giaN5T7ww
Since I'm a beginner, I see myself placing a bunch of buttons on the screen and labeling them to how I see fit. Then figuring out how to move multiple "buttons" at once. I was wondering how you think the tiles are created in this program? If not done by a bunch of buttons, could someone show me code to draw a tile with dimensions of 48x48 pixels, then place a letter on the tile?
Also, if you could point me to some helpful resources that would help me develop something along the lines of a project like this, I would most appreciate it. I'm excited and very motivated to learn and master IOS development and consequently objective-c.
My knowledge is limited to what I've learned by watching and coding along to these two YouTube playlists:
http://www.youtube.com/user/thenewboston#p/c/640F44F1C97BA581
http://www.youtube.com/user/thenewboston#p/c/53038489615793F7
They've been extremely helpful in helping me understand the basics of Objective-C and Iphone development. Unfortunately, it didn't get into drawing and manipulating objects on the screen.
Thanks in advance for your help. I've found this site and its users quite helpful already. :)
I have kind of similar apps in the app store and I used in one case UILabels and in another case UIViews with UIImageViews as subviews. The movement of the labels I have implemented with the methods touchesBegan:withEvent, touchesMoved:withEvent and touchesEnded:withEvent.

Cocos2D camera movement?

What is the best way I center the screen to follow the character? Should I use CCCamera or just move the background around?
I am new to cocos2d so please show me exact code.
BTW: I am also using box2d in this project.
Thanks
Try this...
[self runAction:[CCFollow actionWithTarget:(your hero) worldBoundary:CGRectMake(0,0,1050,350)]];
It will follow your character (your hero).
Hey there,
You have always to choose between the best way and the best way in your situation. A problem has multiple ways how you can solve it. So I can just tell you how I did it.
A few weeks ago I released my first game. (If you are interested check it out: Birdy!) I also used Cocos2d and had the same problem like you. The player should always be in the center of the screen. I've choosen the way to move the background. I added 2 things to the GameScene: The background and the bird. And I set the background as the bird's delegate. So as soon as the bird performs a jump for example, the background is moved in the opposite direction.
I think for my situation it was the best method. But I can't talk about CCCamera because I never did anything with that class...
I hope I could help you a little bit. But it's always a bit difficult to find the right way. So you should also think about things you will optionally add in the future. So perhaps my way does not fit your requirements...
I hope also my english is understandable...
Sandro Meier