Can anyone help convert this this actionscript to Objective-c?
if(mcMain.y >= stage.stageHeight - mcMain.height)
{
mainJumping = false;
mcMain.y = stage.stageHeight - mcMain.height;
}
Specifically the stage.stageHeight and mcMain.height?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Without knowing what
mcMainandstageare, no, not easily. I assume thatstagerefers to the main drawing area; assuming that you are drawing within aUIViewsubclass, you can find the dimensions of the view by callingboundsupon the view:This will return a
CGRect, which in itself is comprised of aCGPoint, calledorigin, and aCGSizecalledsize; these are C-structs:To find the height of the
UIView, you can do so quite simply:Assuming that you are trying to find out the height of the view from within the view class itself.
I’m guessing that
mcMainrefers to some kind of image or object, so implementation of that is dependent on what it is. However, most co-ordinates rely onCGRect,CGPointandCGSizein some way or another.