SKShapeNode move underlying SKSpriteNode elements - sprite-kit

I'm using an SKShapeNode as a container to represent an 8x8 clickable grid of SKSpriteNode nodes. The problem is, when I position the SKShapeNode away from (0,0), the grid itself looks correct but when you click a tile it treats all nodes as if they were positioned at (0,0).
Code for adding the SKShapeNode "board":
board = Board(rows: 8, cols: 8)
board.node.position = CGPoint(x: board.node.position.x, y: middleBorder.position.y-150)
self.addChild(board.node)
This image shows a click to the bottom right tile when the board is positioned at (0,0):
Default positioning
This image shows a click to the same bottom right tile when the board is shifted downwards. As you can see I visually click the bottom right tile but the action registers as if the bottom right tile was at (0,0):
Augmented positioning

Related

random pink square apeared in the tile pallete

a pink square suddenly appeared in tile palette, covering up half of my sprites, it is not a sprite, it appears when I try to place one of my sprites in the tile map, most sprites work, its just this one, when I select the image one pops up next to the name

Rotate a UIButton with an angle by a new anchorPoint

I'm trying to Rotate a button basically with a new anchorPoint. Normally anchor points are right in the center of the views. So I want to change the anchor point to right bottom of the frame of my Button.
I've tried to set an anchor point to the right bottom corner of the button frame and tried to rotate the whole button for 60 degrees to right hand side. It does rotate with the code below. But the rotation seems a bit random to me.
What I wanted was rotating a button with an anchor point(which is right bottom point of the button frame) and rotation angle is meant to be 60 degrees to the right hand side
So here is my basic code.
override func viewDidLoad() {
super.viewDidLoad()
let anchorPoint = CGPoint(x: 1, y: 1)
LoginScreenSelectionButton.layer.anchorPoint = anchorPoint // setting new anchor
LoginScreenSelectionButton.transform = CGAffineTransform(rotationAngle: 0.33)
}
My code seems logical and pretty easy to me. What is wrong about it?
I've added an image below. What I'm actually trying to do is drawing the shape below. I've drawn triangle images from adobe photoshop and added those photos to my button in swift.
Now I want to get a full circle from those triangle buttons. To do that, what I thought to do was creating each triangle button from the same point. So they will be on the top of each other.
To create a circular shape I wanted to change the angles of each triangle by adding 60 degree difference between each other(while the anchor point is the right bottom of the button frames).
With that logic I thought that I Would get a perfect circular shape which is created by 6 triangle shaped buttons. So by creating this shape I get 6 different buttons which seems to create a circular shape all together.
Is that approach logical as well?
EDIT: Sorry for long explanation hopefully that will give some information to you about what I'm trying to accomplish
Triangle Button shapes
Thanks

How can I change in Cinemachine the Game Window Guides center to be on the player center?

On the game view on the left the yellow small square is on the player foot and the whole rectangle on the bottom is down out the view.
How can I move up the yellow small square of the Game Window Guides to be on the player center and that the bottom of the Game Window Guides rectangle will be fit in the game view so I can control it change it's size ?
In this screenshot I'm using paint to add circle/s to explain more what do I mean the yellow small square and what do I mean by fit the size and that is out at the bottom :
I use blue circle to show the yellow small square I meant and blue rectangle to show the bottom that is getting out the Game view :
How can I change in Cinemachine the Game Window Guides center to be on the player center ?
The small yellow square I think and I want to be on the character center body not on his foot.
And on the bottom I can't drag the Game Window Guides since it's out on the bottom.
Under Middle Rig property, change the y-axis from 0 to 1.

How to I make the X and Y position of an object in unity refer to the top left of the object, instead of the center?

the image of the object, with the x and y coordinates referring to the middle of the object
I'm kind of a noob at unity, but I'm pretty sure I've done this before. Is there a way to change the position of the blue circle to the top left of the object?
If That white box is a Sprite, then just click the sprite filed to open it in inspector. And Click [Sprite Editor] button in the middle of inspector. There you can just drag blue circle (the center of that sprite). And then press [Apply] button in inspector.
If that white box is a GUI Image ( I think probably not.) , then you need too do some scripting for it. ( Just Re-Arrange it whit modified center with code )

Swift SKCropNode can someone explain this behavior?

I have a grid of 16 SKCropNode objects. Each contains a SKShapeNode used as a mask, and a SKSpriteNoe. In this image with the mask not set you can see all 16 object appear in a grid.
https://github.com/soggybag/Grid
Interaction is strange also. Tapping makes the image sprite move down and disappear moving out of the mask. You can tap the area below the orange, where a sprite would be hidden, and it recognizes the tap event.
Even stranger you not tap the sprite in the upper right?