react-native-game-engine-ex.../App.tsx

37 lines
844 B
TypeScript
Raw Permalink Normal View History

import React from "react";
2022-06-25 00:29:43 -05:00
import { StatusBar } from "expo-status-bar";
import { SafeAreaProvider } from "react-native-safe-area-context";
import { Logs } from 'expo'
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
2022-06-25 00:29:43 -05:00
import GameEngine from "./game/systems/GameEngine";
2022-06-25 00:29:43 -05:00
export default function App() {
Logs.enableExpoCliLogging()
2022-06-25 00:29:43 -05:00
return (
<>
<StatusBar backgroundColor="orange" hidden={true} />
<SafeAreaProvider>
<SafeView />
2022-06-25 00:29:43 -05:00
</SafeAreaProvider>
</>
);
}
function SafeView() {
const { top, bottom, left, right } = useSafeAreaInsets();
const topInset = top.valueOf();
global.topInset = topInset;
global.bottomInset = bottom;
global.leftInset = left;
global.rightInset = right;
return (
<SafeAreaView>
<GameEngine />
</SafeAreaView>
);
}