Commit 4b118340 authored by wildfirecode13's avatar wildfirecode13

init

parents
node_modules
\ No newline at end of file
declare var FYGE:any;
{
"scripts": {
"start": "webpack serve --open"
},
"devDependencies": {
"ts-loader": "^9.2.6",
"typescript": "^4.4.4",
"webpack": "^5.61.0",
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.4.0"
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="http://yun.duiba.com.cn/db_games/libs0924/fyge2018.minSpine.js" crossorigin="anonymous"></script>
</head>
<body>
<div id="cusEngine" style="line-height:0;font-size:0">
<canvas id="canvas" style="width: 100%;height: 100%"></canvas>
</div>
<script src="bundle.js"></script>
</body>
</html>
\ No newline at end of file
var canvas:any = document.getElementById("canvas")
canvas.width = document.body.clientWidth * 1
canvas.height = document.body.clientHeight * 1
var stage = new FYGE.Stage(
canvas,
750,
1624,
canvas.width,
canvas.height,
FYGE.RENDERER_TYPE.CANVAS,
false,
false
)
stage.addEventListener(FYGE.Event.INIT_STAGE, onInitStage, this);
function onInitStage() {
const textfield = new FYGE.TextField();
textfield.fillColor = '#ff0000';
textfield.text = 'hello world';
textfield.size = 50;
stage.addChild(textfield);
}
(function loop() {
FYGE.Tween.flush()
stage.flush();
requestAnimationFrame(loop);
})();
\ No newline at end of file
{
"compilerOptions": {
"outDir": "./dist/",
"noImplicitAny": true,
"module": "es6",
"target": "es5",
"jsx": "react",
"allowJs": true
},
"include": [
"src",
"defs"
]
}
\ No newline at end of file
const path = require('path');
module.exports = {
mode: 'development',
devtool: 'eval',
entry: './src/main.ts',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
output: {
filename: 'bundle.js',
// path: path.resolve(__dirname, 'dist'),
},
};
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment