Label upside down

Discussion in 'iOS Development' started by Just_For_Now, May 30, 2009.

  1. Just_For_Now

    Just_For_Now Active Member

    Joined:
    Mar 21, 2009
    Messages:
    1,898
    Likes Received:
    1
    Device:
    4G iPod touch
    im making a game with two players and a need a score label to turn upside down for the other player could see it.
  2. Pelaez-1

    Pelaez-1 New Member

    Joined:
    May 5, 2008
    Messages:
    822
    Likes Received:
    0
    Device:
    iPhone
    Add this before adding your label to your view, will rotate it 180 degrees:

    [OBJC][label setTransform:CGAffineTransformMakeRotation(M_PI)];[/OBJC]

    (replace "label" with the name of your label, of course)
  3. Just_For_Now

    Just_For_Now Active Member

    Joined:
    Mar 21, 2009
    Messages:
    1,898
    Likes Received:
    1
    Device:
    4G iPod touch
    thanks ill try it out right now.
  4. ipodmail09

    ipodmail09 Member

    Joined:
    Mar 13, 2009
    Messages:
    269
    Likes Received:
    0
    Device:
    2G iPod touch
    can you please explain better ?
  5. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    Uhm, what are you asking to be explained?
  6. ipodmail09

    ipodmail09 Member

    Joined:
    Mar 13, 2009
    Messages:
    269
    Likes Received:
    0
    Device:
    2G iPod touch
    where do you enter the code ? sorry for being a ubernoob

    -(void)reset

    Please Register or Log in to view images

    BOOL) newGame {
    self.gameState = kGameStatePaused;
    AudioServicesPlaySystemSound (deathFileID);
    ball.center = self.view.center;
    if(newGame) {
    if(computer_score_value > player_score_value) {
    tapToBegin.text = @"Computer Wins!";
    } else {
    tapToBegin.text = @"Adam Wins!";
    }

    computer_score_value = 0;
    player_score_value = 0;
    } else {
    tapToBegin.text = @"Tap To Begin";
    }

    player_score.text = [NSString stringWithFormat

    Please Register or Log in to view images

    "%d",player_score_value];
    computer_score.text = [NSString stringWithFormat

    Please Register or Log in to view images

    "%d",computer_score_value];
    }
  7. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    Where you create the label, before [self.view addSubview:label];
  8. Pelaez-1

    Pelaez-1 New Member

    Joined:
    May 5, 2008
    Messages:
    822
    Likes Received:
    0
    Device:
    iPhone
    You are probably using IB... right?

    In the viewDidLoad method of your UIViewController subclass, add that line of code and just change "label" to whatever your label is named.

Share This Page