This question already has answers here:
Autoscrolling in a UIScrollview
(3 answers)
Closed 8 years ago.
I have already asked the same question a few time but I have had no answer.
I would like to know if someone can help me get a UIScrollview to autoscroll down the page with an incrementally faster speeds.
I also have buttons on the page.
It would also be great when the user touches a button on the page it keeps autoscrolling.
So if you kind of understand it will be like the game Piano Tiles.
I am running Xcode 5. If someone has the solution to my problem please can you tell me what code goes where as I am quite a newby Xcode.
Your help will be greatly appreciated.:)
I suspect the Piano Tiles game is actually using something like Sprite Kit.
This allows a lot more control over thing like "scrolling" speed.
Instead of using a UIScrollView you would use an SKNode as a layer with the buttons added to that parent layer.
Then using the update game loop you can incrementally increase the speed of the movement based on the time since the game started.
In essence... don't use UIScrollView, don't use UIKit, use SpriteKit.
Related
I am currently working on a new project and I need to detect whether my SpriteNode has been touched or not. That is not the problem [yet]. But my SpriteNode includes an Png-Image and due to this it also includes an translucent part. And what I want to do is to "delete"/ignore this non-visible part and only detect whether the visible part has been touched. I tried it on several ways but nothing really worked. I need an reliable way to do that (Swift 4 or 3). I already read other posts but they did not help.
Or maybe you have other ways to determine an touchable area from Png-Image than using a SpriteNode.
This question already has an answer here:
embed live camera view inside a UIView
(1 answer)
Closed 7 years ago.
Just to clarify, I am very new to coding. This project that I am doing right now as one attribute that is way beyond anything I've learned as of yet, but I really would like to figure this out so I can build the rest of my simple app.
In my app I would like to have a live camera feed from the back camera of the iPhone. I don't want this view to take up the entire screen, I want to have it just as a small portion. I don't even want this camera to take pictures I would rather it just have the live feed and that's it. I am using swift and Xcode 7.
Any chance someone can point me to a tutorial or give some advice?
Thanks.
Use AV Foundation. You want an AVCaptureSession (to run the camera) and an AVCaptureVideoPreviewLayer (to display what the camera sees).
I am in talks with a client to do an app, but in it, they are wanting it to revolve around a little character that follows you throughout the app (think Clippy, from the old days of Microsoft Word :)).
One thought I had was, can I use an SKSprite/Node inside an iOS app not using the SpriteKit framework?
Or is this a matter of animating through an array of UIImages?
Those were my first thoughts - does anyone know the best direction to go in for something like this? I need basic animations for a character throughout the whole app.
Depending on the detail of animation needed, you could do it with just CoreAnimation and possibly selectively choosing the image to display in an UIImageView. For example, see the answers to this question: rotate a UIView around its center but several times
Simple answer is, No, out of the box you can't use a class from a framework and choose to not use the framework. Though I'm not exactly sure what that question means. An SKSpriteNode renders via an SKScene node, and an SKScene node renders via an SKView, which is rendered by a View Controller.
You could do something fancy like dedicate the SKView as only part of the screen, and have a standard UIKit view as the other part, or only have the SKView appear on the screen when you needed it I guess.
I'm trying to learn iOS programming and I decided to make a game like Connect 4, or some may know it as Four in a row.
I've done the grid and dropping the tiles. However, I haven't been able to stack the tiles on top of each other. I havent tried that much because I have no idea on how i could do something like that as i have never tried making a game like this, I have also searched online but I dont know if it's my choice of wording that it never shows anything or if there isnt anything like it.
I have 7 column on the top, with a hairline where you touch in order to drop the tile to the grid. Right now the tiles just stack on each other.
Not sure if my response is worth to be an answer but what the heck...
If you are set on not getting into Sprite Kit right now, you could probably use UIButton to make this happen. Divide your screen into a grid of UIButtons. You can set the button images according to empty and played (red or blue). Each button code would have to check for things like if the hole (button) was already played, what color chip to display, is this a winning move, etc... There is of course an easier way to do this instead of copying the same code into each button but I'll let you try to figure that one out for now.
I am currently working on my first IOS app and have sort of hit a 'brick wall' if you will. I am using Cocos2D for most of my graphical interface do to my preference and ease when working with chipmunk.
Currently I am trying to create a scene that has at least 2 layers displayed at once, split screen style. One layer I need to be a vertical scrolling menu, while the other layer I need to be a pan/zoom 'map' type layer. Being the noob that I am when it comes to Objective-C and Cocos2D I can not seem to figure out how to even attempt this. I have done some searching and came across the extensions for Cocos2D which offer the pan/zoom layer.
Any help or pointers to tutorials, references, sites, etc. would be greatly appreciated!