web_game_engine 0.0.2+2 copy "web_game_engine: ^0.0.2+2" to clipboard
web_game_engine: ^0.0.2+2 copied to clipboard

2.5d web game engine for flutter

example/lib/main.dart

import 'dart:html' as html;
import 'package:example/game.dart';
import 'package:flutter_web_plugins/url_strategy.dart';
import 'package:flutter/material.dart';
import 'package:web_game_engine/web_game_engine.dart';

void main() async {
  //await export();
  WidgetsFlutterBinding.ensureInitialized();
  setUrlStrategy(null);
  Engine.init(engineLen: 1280, engineHgt: 720);

  runApp(const App());
}

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    html.document.onContextMenu.listen((event) => event.preventDefault());
    return MaterialApp(
      theme: ThemeData(
          canvasColor: Colors.white,
          textTheme: Theme.of(context).textTheme.apply(
              decoration: TextDecoration.none,
              bodyColor: const Color.fromARGB(255, 0, 0, 0),
              fontSizeFactor: 1.5)),
      home: Scaffold(
        body: const PlayGameWidget(),
        appBar: AppBar(),
      ),
      debugShowCheckedModeBanner: false,
    );
  }
}
4
likes
120
points
0
downloads

Publisher

verified publisherskytopstudio.ru

Weekly Downloads

2.5d web game engine for flutter

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_gl, vector_math

More

Packages that depend on web_game_engine