我寫了這段代碼來停止屏幕上的UIImage
,但這隻適用於左側。我怎樣才能讓這段代碼在右側工作呢?停止屏幕上的物體
注意,UIImage
由加速計控制:
CGFloat leftOfWorld = 0.0f;
CGFloat minCenterX = leftOfWorld + (person.bounds.size.width/2.0f);
person.center = CGPointMake(MAX(minCenterX, person.center.x), person.center.y);
'MIN(maxCenterX,MAX(minCenterX,person.center.x))' – Cyrille
這沒有工作,並通過在景觀方式,它停在屏幕的左側,但不是在右邊 –
在這種情況下,你如何計算maxCenterX? – Cyrille