# How do i rotate the screen off center ?

Get help using Construct 2

### » Tue Feb 21, 2012 2:25 pm

[quote]Make an object rotate around another via events - LINK[/quote]
or this :
[quote]Rotate a layer and still interact with its physical objects as they appear on screen - LINK[/quote]
?
New to Construct ? Where to start

Please attach a capx to any help request or bug report !
Moderator
B
252
S
86
G
42
Posts: 7,031
Reputation: 59,152

### » Tue Feb 21, 2012 2:32 pm

well yes ... now that i saw it i could have used the math formula but its ok i just did it with sine behavior ,,, one more question i made some progress and i have now another problem, when i use the shake action of the object that has scroll everything shakes however i want to exclude some objects... changing layer didnt do the trick , any other ideas ?
B
10
S
2
G
3
Posts: 77
Reputation: 2,934

### » Tue Feb 21, 2012 2:47 pm

or simply
[code]sprite: set X to centerX + cos(angle) * radius
sprite: set Y to centerY + sin(angle) * radius[/code]

if the radius value is the same for X and Y the sprite will be on a circle of this radius
if the radius values are different the sprite will be on an ellipse

That's the basic formula I used for my menu in cubemaze (see below)

Ok I've been kinda ninja'd on this last one. Shouldn't have taken a shower after opening the topic. well..

For the "Shake many objects but not these ones" it depends
If you don't want your HUD to shake you can put all your HUD elements on a layer with parallaxe 0,0 (will never scroll)
Else you will probably have to shake your layout with a scoll+random(-10,10) and counter shake object you don't want to shake by putting them in the same family and applying the inverse translation.
[code]+on what you want
local number randX = 0
local number randY = 0
local number curScrollX = 0
local number curScrollY = 0
+System: trigger once
// store real position on start of shaking
-> System: set curScrollX to scrollX
-> System: set curScrollY to scrollY
-> NoShakeFamily: set self.realX = self.X
-> NoShakeFamily: set self.realY = self.Y
+System: every tick
-> System: set randX to random(-10,10)
-> System: set randY to random(-10,10)
-> System: set scrollX to curScrollX + randX      //Shake
-> System: set scrollY to curScrollY + randY      //Shake
-> NoShakeFamily: set X to self.realX - randX      //Counter-Shake
-> NoShakeFamily: set Y to self.realY - randX      //Counter-Shake[/code]
might work :D
Yann2012-02-21 14:59:31
B
61
S
22
G
14
Posts: 1,480
Reputation: 16,373

### » Tue Feb 21, 2012 3:11 pm

oh i see, soz but i rly didnt see that anybody else had tried it ,i changed the hud (right guess:)) to another layer and parallax set to 0 and its working fine ,many thnks !
B
10
S
2
G
3
Posts: 77
Reputation: 2,934

Previous