@@ -2,6 +2,7 @@ import React from 'react';
2
2
import {
3
3
View ,
4
4
Text ,
5
+ ScrollView ,
5
6
StyleSheet ,
6
7
ImageBackground ,
7
8
} from 'react-native' ;
@@ -10,7 +11,7 @@ import { Audio, Font } from 'expo';
10
11
import LottieView from 'lottie-react-native' ;
11
12
import Button from '../Button' ;
12
13
import { goToMainMenu , startGameSelection } from '../../actions' ;
13
-
14
+ import { scale , moderateScale , verticalScale } from '../../Scaling' ;
14
15
15
16
// Static assets
16
17
const GOOD_ANIMATION = require ( '../../../assets/animations/677-trophy.json' ) ;
@@ -114,7 +115,10 @@ class GameOver extends React.Component {
114
115
resizeMode = "cover"
115
116
>
116
117
{ ( this . state . fontLoaded ) &&
117
- < View style = { styles . gameOverData } >
118
+ < View style = { styles . gameOverData } >
119
+ < ScrollView >
120
+
121
+ < View style = { styles . gameOverInternal } >
118
122
< Text style = { styles . gameOverTitle } > GAME OVER</ Text >
119
123
< LottieView
120
124
style = { styles . statusAnimation }
@@ -134,6 +138,8 @@ class GameOver extends React.Component {
134
138
Back to Main Menu
135
139
</ Button >
136
140
</ View >
141
+ </ ScrollView >
142
+ </ View >
137
143
}
138
144
</ ImageBackground >
139
145
</ View >
@@ -156,9 +162,9 @@ const styles = StyleSheet.create({
156
162
alignItems : 'center'
157
163
} ,
158
164
gameOverData : {
159
- padding : 16 ,
160
- marginTop : 32 ,
161
- marginBottom : 32 ,
165
+ padding : scale ( 16 ) ,
166
+ marginTop : scale ( 32 ) ,
167
+ marginBottom : scale ( 32 ) ,
162
168
alignSelf : 'stretch' ,
163
169
alignItems : 'center' ,
164
170
borderWidth : 2 ,
@@ -167,42 +173,47 @@ const styles = StyleSheet.create({
167
173
justifyContent : 'center' ,
168
174
backgroundColor : 'rgba(255, 255, 255, 0.9)' ,
169
175
} ,
176
+ gameOverInternal : {
177
+ alignSelf : 'stretch' ,
178
+ alignItems : 'center' ,
179
+ justifyContent : 'center' ,
180
+ } ,
170
181
gameOverMessage : {
171
- fontSize : 28 ,
182
+ fontSize : moderateScale ( 28 ) ,
172
183
textAlign : 'center' ,
173
184
fontWeight : "900"
174
185
} ,
175
186
gameOverTitle : {
176
187
fontFamily : "game-over-title" ,
177
188
color : '#000000' ,
178
189
textShadowOffset : { width : - 1 , height : 1 } ,
179
- textShadowRadius : 10 ,
180
- fontSize : 78 ,
181
- marginBottom : - 40 ,
190
+ textShadowRadius : scale ( 10 ) ,
191
+ fontSize : moderateScale ( 78 ) ,
192
+ marginBottom : scale ( - 40 ) ,
182
193
zIndex : 9999
183
194
} ,
184
195
gameScoreText : {
185
196
fontFamily : 'game-over' ,
186
197
fontWeight : "900" ,
187
- fontSize : 32 ,
188
- marginTop : 5 ,
189
- marginBottom : 5 ,
198
+ fontSize : moderateScale ( 32 ) ,
199
+ marginTop : scale ( 5 ) ,
200
+ marginBottom : scale ( 5 ) ,
190
201
} ,
191
202
gameStatusText : {
192
203
fontFamily : 'game-over' ,
193
- fontSize : 24 ,
204
+ fontSize : moderateScale ( 24 ) ,
194
205
fontWeight : "900" ,
195
206
color : '#8f61f9' ,
196
207
marginTop : 2 ,
197
208
marginBottom : 2 ,
198
209
} ,
199
210
mainMenuButton : {
200
- marginBottom : 50 ,
211
+ marginBottom : scale ( 50 ) ,
201
212
backgroundColor : '#DC143C'
202
213
} ,
203
214
statusAnimation : {
204
- width : 200 ,
205
- height : 200
215
+ width : scale ( 200 ) ,
216
+ height : scale ( 200 )
206
217
} ,
207
218
} ) ;
208
219
0 commit comments