-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1495 from flexn-io/fix/lightningjs
Fix/lightningjs + unlock engine change using command options
- Loading branch information
Showing
13 changed files
with
136 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
import './src/entry/'; //eslint-disable-line | ||
import Main from './src/entry'; | ||
|
||
export default Main; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "app-harness", | ||
"identifier": "com.app.harness", | ||
"version": "1.0.0", | ||
"icon": "./static/icon.png" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"appSettings": { | ||
"stage": { | ||
"clearColor": "0x00000000", | ||
"useImageWorker": true | ||
}, | ||
"debug": false | ||
}, | ||
"platformSettings": { | ||
"path": "./static", | ||
"log": true, | ||
"showVersion": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Router, Utils } from '@lightningjs/sdk'; | ||
import HomeScreen from '../components/HomeScreen/index.lng'; | ||
export default class App extends Router.App { | ||
static getFonts() { | ||
return [{ family: 'Inter-Light', url: Utils.asset('fonts/Inter-Light.ttf') }]; | ||
} | ||
|
||
_setup() { | ||
Router.startRouter({ | ||
root: 'home', | ||
routes: [ | ||
{ | ||
path: 'home', | ||
component: HomeScreen as any, | ||
}, | ||
], | ||
}); | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
packages/app-harness/src/components/HomeScreen/index.lng.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Utils } from '@lightningjs/sdk'; | ||
import Lightning from '@lightningjs/core'; | ||
import { Api } from '@rnv/renative'; | ||
import config from '../../../package.json'; | ||
|
||
interface HomeTemplateSpec extends Lightning.Component.TemplateSpec { | ||
color: number; | ||
} | ||
export interface HomeTypeConfig extends Lightning.Component.TypeConfig { | ||
IsPage: true; | ||
} | ||
|
||
export default class Home | ||
extends Lightning.Component<HomeTemplateSpec, HomeTypeConfig> | ||
implements Lightning.Component.ImplementTemplateSpec<HomeTemplateSpec> | ||
{ | ||
static _template() { | ||
return { | ||
rect: true, | ||
w: 1920, | ||
h: 1080, | ||
color: 0xffffffff, | ||
flex: { justifyContent: 'center', direction: 'column', alignItems: 'center' } as const, | ||
Logo: { | ||
w: 150, | ||
h: 150, | ||
src: Utils.asset('icon.png'), | ||
flexItem: { marginBottom: 50 }, | ||
}, | ||
Text1: this._renderText('ReNative Harness', 56, 'bold'), | ||
Text2: this._renderText( | ||
`v${config.version}, platform: ${Api.platform}, factor: ${Api.formFactor}, engine: ${Api.engine}`, | ||
25 | ||
), | ||
}; | ||
} | ||
|
||
static _renderText(text: string, size: number, style = 'normal') { | ||
return { | ||
text: { | ||
text: text, | ||
fontSize: size, | ||
fontStyle: style, | ||
textColor: 0xff000000, | ||
}, | ||
}; | ||
} | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters