2
0
mirror of https://github.com/raylib-cs/raylib-cs synced 2025-09-09 03:01:41 -04:00
Files
raylib-cs/Raylib-cs.Android.Sample/MainActivity.cs
2023-07-24 18:16:40 +07:00

35 lines
996 B
C#

using System.Runtime.InteropServices;
using Android.Content;
using Android.Content.PM;
namespace Raylib_cs.Android;
[
Activity(
Label = "@string/app_name",
MainLauncher = true,
ConfigurationChanges = ConfigChanges.Orientation
| ConfigChanges.KeyboardHidden
| ConfigChanges.ScreenSize,
ScreenOrientation = ScreenOrientation.Landscape,
ClearTaskOnLaunch = true
),
IntentFilter(new[] { Intent.ActionMain }),
MetaData(NativeActivity.MetaDataLibName, Value = "raylib")
]
public class MainActivity : RaylibActivity
{
protected override void OnReady()
{
Raylib.InitWindow(0, 0, "android_window");
while (!Raylib.WindowShouldClose())
{
Raylib.BeginDrawing();
Raylib.ClearBackground(Color.WHITE);
Raylib.DrawFPS(10, 10);
Raylib.DrawText("Hello Raylib-cs.Android", 20, 100, 100, Color.BLACK);
Raylib.EndDrawing();
}
}
}