This repository was archived by the owner on Sep 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed
Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 11using SharpEngine ;
2+ using SharpEngine . Component ;
3+ using SharpEngine . Entity ;
4+ using SharpEngine . Manager ;
25using SharpEngine . Math ;
3- using SharpEngine . Widget ;
6+ using SharpEngine . Utils ;
7+ using SharpEngine . Utils . Input ;
8+ using tainicom . Aether . Physics2D . Dynamics ;
49
510namespace SE_BasicWindow ;
611
712internal class MyScene : Scene
813{
914 public MyScene ( )
1015 {
11- var scrollFrame = AddWidget ( new ScrollFrame ( new Vec2 ( 300 ) , new Vec2 ( 200 ) ) ) ;
16+ var e1 = new Entity ( ) ;
17+ e1 . AddComponent ( new TransformComponent ( new Vec2 ( 100 ) ) ) ;
18+ e1 . AddComponent ( new RectComponent ( Color . Blue , new Vec2 ( 50 ) ) ) ;
19+ e1 . AddComponent ( new PhysicsComponent ( ignoreGravity : true , fixedRotation : true ) ) . AddRectangleCollision ( new Vec2 ( 50 ) ) ;
20+ e1 . AddComponent ( new ControlComponent ( ) ) ;
21+ AddEntity ( e1 ) ;
22+
23+ var e2 = new Entity ( ) ;
24+ e2 . AddComponent ( new TransformComponent ( new Vec2 ( 200 ) ) ) ;
25+ e2 . AddComponent ( new RectComponent ( Color . Red , new Vec2 ( 50 ) ) ) ;
26+ e2 . AddComponent ( new PhysicsComponent ( BodyType . Static , ignoreGravity : true , fixedRotation : true ) ) . AddRectangleCollision ( new Vec2 ( 50 ) ) ;
27+ AddEntity ( e2 ) ;
28+ }
29+
30+ public override void Update ( float delta )
31+ {
32+ base . Update ( delta ) ;
1233
13- for ( int i = 0 ; i < 500 ; i += 50 )
14- scrollFrame . AddChild ( new Label ( new Vec2 ( 0 , i ) , $ "Test { i } ", "basic" ) ) ;
34+ Window ! . CameraManager . Rotation += 10 * delta ;
1535 }
1636}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ private static void Main()
1313 {
1414 RenderImGui = win =>
1515 {
16- DebugManager . CreateSeImGuiWindow ( ) ;
16+ DebugManager . CreateSeImGuiWindow ( win ) ;
1717 ImGui . Begin ( "Basic Game Debug" ) ;
1818 if ( ImGui . Button ( "Stop Window" ) )
1919 win . Stop ( ) ;
You can’t perform that action at this time.
0 commit comments