empathy-php/litengine

轻量级Empathy框架引擎版本

0.1.2 2021-04-10 17:49 UTC

This package is auto-updated.

Last update: 2024-09-11 01:40:32 UTC


README

🚀 Empathy Litengine

Latest Stable Version Total Downloads License

Empathy Litengine - Empathy Engine的简化版本 Empathy Engine

安装

composer require empathy-php/litengine

Empathy CoreEmpathy Litecore 共同使用

为了更好地工作,建议在根文件 composer.json 中添加以下代码

{
    "scripts": {
        "empathy-run": "vendor/empathy-php/litecore/empathy.exe vendor/empathy-php/core/script.php"
    }
}

之后就可以执行代码

composer empathy-run

来启动项目

应用程序代码可以写在项目根目录下的 app.php 文件中

示例工作

app.php

<?php

require 'vendor/autoload.php';

use function Empathy\Engine\dn;

$form   = dn ('System.Windows.Forms.Form');
$button = dn ('System.Windows.Forms.Button');

$form->text = 'Example app';

$button->parent = $form;

$button->left   = 16;
$button->top    = 16;
$button->width  = 96;
$button->height = 32;

$button->text = 'Click me!';

$button->on ('click', function ()
{
    dn ('System.Windows.Forms.MessageBox')->show ('Hello, World!');
});

$form->showDialog ();

作者: Подвирный Никита