skview

Lag / Delay on ModalViewController dismiss after loading an xib view over SKView

你说的曾经没有我的故事 提交于 2019-12-25 04:06:55
问题 Imagine this scenario (some code below): I have an SKView on a viewcontroller. I load an xib view (external .xib file) over skview (xib view is a like small menu view that does not cover screen in full). Then, I show a view controller modally from SKView's controller When I dismiss this modal view controller, there is a lag on every second dismissal (so, i show it modally, dismiss, it is fine, then i repeat, there is delay, then repeat, works fine, then do again, there is delay ... and so on)

Swift3: UISwipeGestureRecognizer in only one of putatively many SKViews

回眸只為那壹抹淺笑 提交于 2019-12-24 10:54:17
问题 Note: Prior to asking this question I have viewed and attempted solutions posted for the following questions: gesture recognizer with sprite kit and swift Swift3 iOS - How to make UITapGestureRecognizer trigger function how to add a gesture to skView? using UIGestureRecognizer with Swift Context: I have implemented a basic game menu for my game following the example set here. When I reach the GameScene I would like to have a UIGestureRecognizer that when the screen is swiped up, opens a pause

Sprites must be cleaned before switch scenes with SpriteKit and Swift?

不想你离开。 提交于 2019-12-13 04:43:35
问题 There are two scenes(scene1, scene2) in my game, both of them have some sprites. scene1 will be presented at first with skView. scene2 will be presented with the same skView when the hero is stronger. In case the hero is weak, scene1 will be presented again. (Here is the question point.) In my case the sprites which were added to the scene1, are added to the scene1 again (I mean they are doubled). I did another test, where i presented the scene1 just twice one after the other. I got the same

Why aren't the backgrounds within these UITextViews clear?

大城市里の小女人 提交于 2019-12-13 03:44:01
问题 I am attempting to display individual characters in the exact positions that they would appear if displayed as a single string with kerning. The problem is that the characters' bounding boxes seem to be opaque, so that each newly added character covers some of the prior one. Where kerning is greater (e.g., in the combination "ToT"), the problem is obvious: My setup is something like this: I have an SKView embedded in a container view. In an extension of the SKView's view controller, the

UIView won't cast to SKView

梦想的初衷 提交于 2019-12-11 22:52:16
问题 I've been trying to implement Game Center in my Sprite Kit game, but every time I try to present the leaderboard... -(void)showLeaderboard:(UIViewController*)gcvc { GKGameCenterViewController *leaderboardController = [[GKGameCenterViewController alloc] init]; if (leaderboardController != NULL) { leaderboardController.leaderboardIdentifier = @"Game_Leaderboard"; leaderboardController.viewState = GKGameCenterViewControllerStateLeaderboards; leaderboardController.gameCenterDelegate = self;

Why does setting frameInterval on a SKView not work?

眉间皱痕 提交于 2019-12-11 13:43:56
问题 I'm trying to reduce the framerate to a maximum of 30 FPS. The official documentation says to use: skView.frameInterval = 2; I read through all the available documentations as well as every similar question asked here on stackoverflow or in other pages/blogs/etc. I tried it in so many ways but where ever I tried to set the property it did not affect the FPS. I am not using any other timing mechanisms than those from SpriteKit. I am setting it up accordingly to the documentation and to the

Horizontal scrolling in SpriteKit (vs. a viewcontroller)

人走茶凉 提交于 2019-12-10 15:22:41
问题 I'm a little confused about the right way to approach this: In my game, I allow the player to choose from 5 areas to play. An area is nothing more than a rectangle on a screen with the % of your completion in that area. The entire list is centered and looks good. ..Eventually there will be more areas but I don't want them to be on multiple rows (I'd like the player to swipe to scroll through them). To date, all of the features of my game have been cone using SpriteKit (I only have one view

Difference between paused property of SKScene and SKView

ぃ、小莉子 提交于 2019-12-09 05:23:01
问题 I am pausing my SKScene using the following code: self.paused = YES; However, according to this answer by Andrey Gordeev, one can also pause a scene using this line: self.view.paused = YES; I would like to understand what difference it would make to call the either (or both) to pause a scene. 回答1: Pausing SKView stops calling update: method for SKScene . Pausing SKScene doesn't do that. I usually pause both SKScene and SKView EDIT: As of iOS9 pausing the scene will pause the update: method.

Adding UITextView to a scene in SpriteKit

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 08:36:40
问题 I trying to create a game, and following Apple's advice I am using multiple scenes. You could consider the game to be a text heavy point and click adventure. Therein lies the problem. Lots of text, having done a bit of a search, it seems the recommend way, or rather the current only way to do this is with a UITextView thus: [self.view addSubview: textView]; This is all well and good if you only have one SKScene , as that is the scene being displayed by the current view/SKView. My problem is,

Force change interface orientation between scenes

旧巷老猫 提交于 2019-12-08 07:46:43
问题 How can I force the game to switch from portrait (Scene 1) to landscape mode (HomeScene) in between scenes? I have two scenes, Scene1 (which is portrait) and HomeScene (which is designed to be landscape) I am calling this line from Scene 1. -(void)gotoHome { //Would like to change interface orientation here. HomeScene *scene = [HomeScene sceneWithSize:self.size]; [self.view presentScene:scene]; } Problem is, both the scenes are being rendered on the same view. How can I tell a viewController