added wasm example to itch
This commit is contained in:
parent
808dc98488
commit
6969a03bb8
6 changed files with 69 additions and 26 deletions
|
@ -1,26 +0,0 @@
|
|||
FileVersion = 1
|
||||
Projects = {TheaterGui = {Path = "."}, raylib-beef = {Path = "../../External/raylib-beef/raylib-beef"}, ExampleGui = {Path = "../../../Projects/ExampleGui"}}
|
||||
|
||||
[Workspace]
|
||||
StartupProject = "ExampleGui"
|
||||
|
||||
[Configs.Debug.Win64]
|
||||
ConfigSelections = {raylib-beef = {Config = "StaticDebug"}}
|
||||
|
||||
[Configs.Debug.wasm32]
|
||||
AllocType = "CRT"
|
||||
EnableObjectDebugFlags = false
|
||||
EmitObjectAccessCheck = false
|
||||
|
||||
[Configs.Release.Win64]
|
||||
ConfigSelections = {raylib-beef = {Config = "StaticRelease"}}
|
||||
|
||||
[Configs.Paranoid.wasm32]
|
||||
AllocType = "CRT"
|
||||
EnableObjectDebugFlags = false
|
||||
EmitObjectAccessCheck = false
|
||||
|
||||
[Configs.Test.wasm32]
|
||||
AllocType = "CRT"
|
||||
EnableObjectDebugFlags = false
|
||||
EmitObjectAccessCheck = false
|
|
@ -4,3 +4,6 @@ Dependencies = {corlib = "*", TheaterGui = "*"}
|
|||
[Project]
|
||||
Name = "examples"
|
||||
StartupObject = "examples.Program"
|
||||
|
||||
[Configs.Release.wasm32]
|
||||
OtherLinkFlags = "$(LinkFlags) --shell-file $(ProjectDir)/index.html"
|
||||
|
|
|
@ -3,3 +3,18 @@ Projects = {examples = {Path = "."}, TheaterGui = {Path = ".."}}
|
|||
|
||||
[Workspace]
|
||||
StartupProject = "examples"
|
||||
|
||||
[Configs.Debug.wasm32]
|
||||
AllocType = "CRT"
|
||||
EnableObjectDebugFlags = false
|
||||
EmitObjectAccessCheck = false
|
||||
|
||||
[Configs.Paranoid.wasm32]
|
||||
AllocType = "CRT"
|
||||
EnableObjectDebugFlags = false
|
||||
EmitObjectAccessCheck = false
|
||||
|
||||
[Configs.Test.wasm32]
|
||||
AllocType = "CRT"
|
||||
EnableObjectDebugFlags = false
|
||||
EmitObjectAccessCheck = false
|
||||
|
|
45
examples/index.html
Normal file
45
examples/index.html
Normal file
|
@ -0,0 +1,45 @@
|
|||
<!doctype html>
|
||||
<title>Game</title>
|
||||
<meta name=viewport content="width=device-width, maximum-scale=1.0, user-scalable=no, viewport-fit=cover, interactive-widget=resizes-content">
|
||||
|
||||
<style>
|
||||
:root, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
contain: strict;
|
||||
}
|
||||
canvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0;
|
||||
background: black;
|
||||
}
|
||||
</style>
|
||||
|
||||
<canvas id=canvas></canvas>
|
||||
|
||||
<script>
|
||||
let canvas = window.canvas
|
||||
|
||||
function updateCanvasSize() {
|
||||
const box = canvas.getBoundingClientRect()
|
||||
canvas.width = box.width * devicePixelRatio
|
||||
canvas.height = box.height * devicePixelRatio
|
||||
}
|
||||
|
||||
updateCanvasSize()
|
||||
addEventListener('resize', updateCanvasSize)
|
||||
|
||||
Module = {
|
||||
canvas,
|
||||
arguments: location.hash.slice(1).split(' '),
|
||||
}
|
||||
|
||||
onerror = (...args) => {
|
||||
alert(JSON.stringify(args))
|
||||
}
|
||||
</script>
|
||||
|
||||
{{{ SCRIPT }}}
|
|
@ -20,14 +20,18 @@ class ExampleToolbar : Toolbar
|
|||
|
||||
public void PrintVersion()
|
||||
{
|
||||
#if !BF_PLATFORM_WASM
|
||||
System.Console.WriteLine("1.0");
|
||||
#endif
|
||||
}
|
||||
|
||||
public void PrintAbout()
|
||||
{
|
||||
#if !BF_PLATFORM_WASM
|
||||
System.Console.WriteLine("""
|
||||
TheaterGui by Booklordofthedings
|
||||
A simple easy to use gui library for tools
|
||||
""");
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -18,6 +18,8 @@ class HorSlider : HSlider
|
|||
|
||||
public override void OnValueChange(float newVal)
|
||||
{
|
||||
#if !BF_PLATFORM_WASM
|
||||
System.Console.WriteLine(Value);
|
||||
#endif
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue