project_files/HedgewarsMobile/Classes/HelpPageInGameViewController.m
changeset 6830 d2df090453aa
parent 6700 e04da46ee43c
child 6832 fae8fd118da9
equal deleted inserted replaced
6829:60b039d88dab 6830:d2df090453aa
       
     1 /*
       
     2  * Hedgewars-iOS, a Hedgewars port for iOS devices
       
     3  * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@gmail.com>
       
     4  *
       
     5  * This program is free software; you can redistribute it and/or modify
       
     6  * it under the terms of the GNU General Public License as published by
       
     7  * the Free Software Foundation; version 2 of the License
       
     8  *
       
     9  * This program is distributed in the hope that it will be useful,
       
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12  * GNU General Public License for more details.
       
    13  *
       
    14  * You should have received a copy of the GNU General Public License
       
    15  * along with this program; if not, write to the Free Software
       
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
       
    17  *
       
    18  * File created on 30/08/2010.
       
    19  */
       
    20 
       
    21 
       
    22 #import "HelpPageInGameViewController.h"
       
    23 
       
    24 
       
    25 @implementation HelpPageInGameViewController
       
    26 @synthesize scrollView;
       
    27 
       
    28 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
       
    29     return rotationManager(interfaceOrientation);
       
    30 }
       
    31 
       
    32 -(void) didReceiveMemoryWarning {
       
    33     [super didReceiveMemoryWarning];
       
    34     self.scrollView = nil;
       
    35 }
       
    36 
       
    37 // on iPhone the XIBs contain UIScrollView
       
    38 -(void) viewDidLoad {
       
    39     if (IS_IPAD() == NO) {
       
    40         scrollView.contentSize = CGSizeMake(480,470);
       
    41         scrollView.maximumZoomScale = 4.0;
       
    42         scrollView.minimumZoomScale = 0.75;
       
    43         scrollView.clipsToBounds = YES;
       
    44         scrollView.delegate = self;
       
    45     }
       
    46     [super viewDidLoad];
       
    47 }
       
    48 
       
    49 -(void) viewDidUnload {
       
    50     [super viewDidUnload];
       
    51     self.scrollView = nil;
       
    52 }
       
    53 
       
    54 -(void) dealloc {
       
    55     releaseAndNil(scrollView);
       
    56     [super dealloc];
       
    57 }
       
    58 
       
    59 -(IBAction) dismiss {
       
    60     [UIView beginAnimations:@"dismiss help" context:NULL];
       
    61     self.view.alpha = 0;
       
    62     [UIView commitAnimations];
       
    63     [self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:1];
       
    64 }
       
    65 
       
    66 @end