(iOS) Make pause button briefly visible when game starts (again), and give it an image background.

I took ps_next.png from the overlays dir and flipped it, 'cause I'm lazy.
This commit is contained in:
meancoot 2013-03-03 23:28:22 -05:00
parent bda93007bc
commit e058034a24
4 changed files with 49 additions and 36 deletions

View File

@ -42,12 +42,15 @@
<string key="NSFrameSize">{768, 1005}</string>
<reference key="NSSuperview" ref="191373211"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor" id="107526919">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
<bool key="IBUIOpaque">NO</bool>
<int key="IBUIContentMode">5</int>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Pause</string>
<object class="NSColor" key="IBUIHighlightedTitleColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
@ -56,9 +59,10 @@
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
<reference key="IBUINormalTitleShadowColor" ref="107526919"/>
<object class="NSCustomResource" key="IBUINormalBackgroundImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">ic_pause.png</string>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">2</int>
@ -75,13 +79,7 @@
<reference key="NSSuperview"/>
<reference key="NSNextKeyView" ref="1072319895"/>
<string key="NSHuggingPriority">{250, 250}</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<reference key="IBUIBackgroundColor" ref="107526919"/>
<bool key="IBUIOpaque">NO</bool>
<float key="IBUIAlpha">0.0</float>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
@ -114,21 +112,21 @@
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<array class="NSMutableArray" key="children">
<object class="IBNSLayoutConstraint" id="901480461">
<object class="IBNSLayoutConstraint" id="483291458">
<reference key="firstItem" ref="1072319895"/>
<int key="firstAttribute">4</int>
<int key="firstAttribute">10</int>
<int key="relation">0</int>
<reference key="secondItem" ref="191373211"/>
<int key="secondAttribute">4</int>
<int key="secondAttribute">10</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">0.0</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="191373211"/>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
<int key="scoringType">5</int>
<float key="scoringTypeFloat">22</float>
<int key="contentType">2</int>
</object>
<object class="IBNSLayoutConstraint" id="446468022">
<reference key="firstItem" ref="1072319895"/>
@ -215,8 +213,8 @@
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">70</int>
<reference key="object" ref="901480461"/>
<int key="objectID">72</int>
<reference key="object" ref="483291458"/>
<reference key="parent" ref="191373211"/>
</object>
</array>
@ -227,30 +225,36 @@
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<array key="1.IBViewMetadataConstraints">
<array class="NSMutableArray" key="1.IBViewMetadataConstraints">
<reference ref="474429653"/>
<reference ref="925773848"/>
<reference ref="446468022"/>
<reference ref="901480461"/>
<reference ref="483291458"/>
</array>
<string key="54.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="0.0" key="54.IBUIButtonInspectorSelectedEdgeInsetMetadataKey"/>
<real value="0.0" key="54.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<boolean value="NO" key="54.IBViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="61.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="63.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="69.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="70.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="72.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">71</int>
<int key="maxID">72</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
<string key="NS.key.0">ic_pause.png</string>
<string key="NS.object.0">{100, 40}</string>
</object>
<bool key="IBDocument.UseAutolayout">YES</bool>
<string key="IBCocoaTouchPluginVersion">2083</string>
</data>

BIN
ios/Assets/ic_pause.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -125,6 +125,8 @@
966B9CCA16E41EC1005B61E1 /* PauseView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 966B9CC716E41EC1005B61E1 /* PauseView.xib */; };
966B9CCB16E41EC1005B61E1 /* PauseIndicatorView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 966B9CC816E41EC1005B61E1 /* PauseIndicatorView.xib */; };
966B9CCC16E41EC1005B61E1 /* PauseIndicatorView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 966B9CC816E41EC1005B61E1 /* PauseIndicatorView.xib */; };
967D646F16E45428006BA1F2 /* ic_pause.png in Resources */ = {isa = PBXBuildFile; fileRef = 967D646E16E45428006BA1F2 /* ic_pause.png */; };
967D647016E45428006BA1F2 /* ic_pause.png in Resources */ = {isa = PBXBuildFile; fileRef = 967D646E16E45428006BA1F2 /* ic_pause.png */; };
96AFAE2A16C1D4EA009DE44C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96AFAE2916C1D4EA009DE44C /* UIKit.framework */; };
96AFAE2C16C1D4EA009DE44C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96AFAE2B16C1D4EA009DE44C /* Foundation.framework */; };
96AFAE2E16C1D4EA009DE44C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96AFAE2D16C1D4EA009DE44C /* CoreGraphics.framework */; };
@ -233,6 +235,7 @@
966B9CBC16E41E7A005B61E1 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
966B9CC716E41EC1005B61E1 /* PauseView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PauseView.xib; sourceTree = "<group>"; };
966B9CC816E41EC1005B61E1 /* PauseIndicatorView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PauseIndicatorView.xib; sourceTree = "<group>"; };
967D646E16E45428006BA1F2 /* ic_pause.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ic_pause.png; sourceTree = "<group>"; };
96AFAE2516C1D4EA009DE44C /* RetroArch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RetroArch.app; sourceTree = BUILT_PRODUCTS_DIR; };
96AFAE2916C1D4EA009DE44C /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
96AFAE2B16C1D4EA009DE44C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@ -464,6 +467,7 @@
966B9CBA16E41E7A005B61E1 /* Default@2x.png */,
962979F416C43B9500E6DCE0 /* ic_dir.png */,
962979F516C43B9500E6DCE0 /* ic_file.png */,
967D646E16E45428006BA1F2 /* ic_pause.png */,
966B9CBB16E41E7A005B61E1 /* Icon-72.png */,
966B9CBC16E41E7A005B61E1 /* Icon.png */,
966B9CC716E41EC1005B61E1 /* PauseView.xib */,
@ -832,6 +836,7 @@
966B9CC616E41E7A005B61E1 /* Icon.png in Resources */,
966B9CCA16E41EC1005B61E1 /* PauseView.xib in Resources */,
966B9CCC16E41EC1005B61E1 /* PauseIndicatorView.xib in Resources */,
967D647016E45428006BA1F2 /* ic_pause.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -850,6 +855,7 @@
966B9CC516E41E7A005B61E1 /* Icon.png in Resources */,
966B9CC916E41EC1005B61E1 /* PauseView.xib in Resources */,
966B9CCB16E41EC1005B61E1 /* PauseIndicatorView.xib in Resources */,
967D646F16E45428006BA1F2 /* ic_pause.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -152,6 +152,17 @@
_pauseView.frame = CGRectMake(width / 2.0f - 150.0f, height / 2.0f - 150.0f, 300.0f, 300.0f);
_pauseIndicatorView.frame = CGRectMake(tenpctw * 4.0f, 0.0f, tenpctw * 2.0f, tenpcth);
_pauseIndicatorView.hidden = NO;
[self performSelector:@selector(hidePauseButton) withObject:self afterDelay:3.0f];
}
- (void)hidePauseButton
{
[UIView animateWithDuration:0.2
animations:^ { _pauseIndicatorView.alpha = ALMOST_INVISIBLE; }
completion:^(BOOL finished) { }
];
}
- (void)pushViewController:(UIViewController*)theView isGame:(BOOL)game
@ -171,8 +182,8 @@
{
_game = (RAGameView*)theView;
_pauseIndicatorView.alpha = ALMOST_INVISIBLE;
_pauseIndicatorView.userInteractionEnabled = YES;
_pauseIndicatorView.alpha = 1.0f;
_pauseIndicatorView.hidden = YES;
[theView.view addSubview:_pauseView];
[theView.view addSubview:_pauseIndicatorView];
@ -303,11 +314,7 @@
stateSelect.selectedSegmentIndex = (g_extern.state_slot < 10) ? g_extern.state_slot : -1;
[UIView animateWithDuration:0.2
animations:^
{
_pauseIndicatorView.alpha = ALMOST_INVISIBLE;
_pauseView.alpha = 1.0f;
}
animations:^ { _pauseView.alpha = 1.0f; }
completion:^(BOOL finished){}];
}
}
@ -339,11 +346,7 @@
{
if (_isPaused)
[UIView animateWithDuration:0.2
animations:^
{
_pauseView.alpha = 0.0f;
_pauseIndicatorView.alpha = ALMOST_INVISIBLE;
}
animations:^ { _pauseView.alpha = 0.0f; }
completion:^(BOOL finished)
{
_isPaused = false;