Skip to content

Instantly share code, notes, and snippets.

@agasiev
Created October 9, 2012 23:00
Show Gist options
  • Save agasiev/3862007 to your computer and use it in GitHub Desktop.
Save agasiev/3862007 to your computer and use it in GitHub Desktop.
UI scale subsystem
#import "Settings.h"
@interface MainMenuScreen : MenuScreen {
@private
/*
Usage in code:
drButton * button = ...;
button.position = ui.menuButtons;
*/
class MainMenuUI {
public:
CGPoint menuButtons;
MainMenuUI() {
if (Settings::device.name == iPhone || Settings::device.name == iPhoneRetina) {
menuButtons = ccp(0, 200);
}
else if (Settings::device.name == iPad || Settings::device.name == iPadRetina) {
menuButtons = ccp(0, 300);
}
};
} ui;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment