Questions tagged [zposition]

The Euler rotation about the z axis (in radians).

34 questions
9
votes
1 answer

Swift CoreAnimation: zPosition should be within (-FLT_MAX, FLT_MAX) range

I want to keep a view always at the front. In Swift CGFLOAT_MAX and FLT_MAX are replaced with corresponding .greatestFiniteMagnitude. So, I used: view.layer.zPosition = .greatestFiniteMagnitude It works fine, but now I get a…
timaktimak
  • 1,380
  • 1
  • 12
  • 21
4
votes
0 answers

UIButton not receiving touches when superview has a zposition

I have a view which has three buttons. If i set the zPosition of the view to bring it on top the buttons placed on it do not receive touches. However as soon as leave the zPosition of the view to the default the buttons start to receive touches. I…
Win Coder
  • 6,628
  • 11
  • 54
  • 81
2
votes
1 answer

How to move emitter node to front?

Background's zPosition is 1 and emitter node's is 2. Still background is on front. I even tried higher numbers, but it won't help. Code SKSpriteNode *bg = [SKSpriteNode spriteNodeWithImageNamed:@"TiltToMove_BG"]; bg.size = self.size; bg.zPosition =…
Nielsapp
  • 302
  • 1
  • 11
2
votes
2 answers

SKSpriteNodeChild in the wrong zPosition

I'm adding two SKSpriteNodes as children to another SKSpriteNode. The code looks like this: let parentNode = SKSpriteNode(imageNamed: "ParentImage") parentNode.position = CGPointMake(0,0) parentNode.zPosition = 0 let child1 =…
Shane O'Seasnain
  • 3,534
  • 5
  • 24
  • 31
2
votes
1 answer

enum and zPosition problems in spriteKit

I am having some problems with enum used for establish zPositiion in sprite Kit. Here is the enum: enum Layer:CGFloat { case Sky = 0 case Clouds = 1 case Background = 2 case Foreground = 3 case Character = 4 case Foreground1 =…
iOSTony
  • 165
  • 1
  • 11
1
vote
1 answer

Changing zPosition does not change the view hierarchy

I am building a card view - the selected card is on the top, the rest are on the bottom, stacked on top of each other. They all have the same superview. The selected card has zPosition = 0, cards in the stack have increasing zPositions: 1,2,3…
1
vote
2 answers

Badge is displayed behind UIButton

I've created a custom class that adds a badge to a UIButton. The badge itself is a UIImageView. The button can have a different UI for each state; when the button is disabled it has a clear background, it shows a border and the title, as shown in…
Raoul
  • 101
  • 9
1
vote
0 answers

swift iOS place view over keyboard

I am working on a view in my app involves 3 main parts: A custom in-app keyboard A 'Controller' view, which is actually another ViewController in a container view with multiple controls and the textField that has my custom keyboard as…
Joris416
  • 4,751
  • 5
  • 32
  • 59
1
vote
1 answer

IOS 11 - MKMapView pin dialog not clickable when another pin is behind

I did notice an issue on IOS 11 when using MKMapView. When I want to click on the button action from the pin dialog and there is another pin behind the button action, it does not get the gesture. It should be something about zPosition, but I don't…
1
vote
1 answer

Bring view to front even if it not in right hierarchy order

I know that "how to bring view to front", was asked many time, and I don't look for another : self.bringSubview(toFront: myView) My problem why this is not working is, that I have different hierarchical structure. I have UIView on witch I add…
Marko Zadravec
  • 8,298
  • 10
  • 55
  • 97
1
vote
0 answers

What is the relative order of a child with no zPosition (0)?

I read the Sprite Programing guide and they describe how children's zPosition is based off it's parent. For example if parent has 100 zPosition and the child has 1 zPosition. The child will have a relative (to scene) zPosition of 101. Assuming…
3366784
  • 2,423
  • 1
  • 14
  • 27
1
vote
2 answers

SpriteKit - Why SKNode's are not being touch detected

I have reviewed countless references to try to understand why my scene is not behaving the way i expected it to, such as this. Here is my very simple SKScene (2 child nodes): The scene has a SpriteNode (which covers the entire scene as a background…
AlvinfromDiaspar
  • 6,611
  • 13
  • 75
  • 140
1
vote
0 answers

iOS SpriteKit - Touch at a specific location, want node at specific zPosition

I have a project where when I tap I check to see if the tap is on a specific node. If it is then I create a new SpriteNode at that position that is only visible for .1s before being deleted. I want to be able to spam tapping on the screen but with…
Shane Kent
  • 11
  • 1
1
vote
0 answers

How can I set AVCapture preview layer as a background of a sprite kit?

I am trying to draw lines into my SKScene and I can successfully draw it but I want that lines in front of AVCapturePreviewLayer but I am getting something like this : I want all the line above my cameraPreviewLayer. and this is my code for…
Dharmesh Kheni
  • 71,228
  • 33
  • 160
  • 165
1
vote
2 answers

In SpriteKit, how is zPosition used for rendering and for hit tests?

Edit: Apple fixed this in iOS8, so it was certainly not expected/intended but a bug. It appears that the zPosition is interpreted differently when used for rendering a node vs when used for determining which node is touched. When I create a…
Pieter
  • 17,435
  • 8
  • 50
  • 89
1
2 3