# LuaGui **Repository Path**: willowish/LuaGui ## Basic Information - **Project Name**: LuaGui - **Description**: Lua GUI 跨平台库 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2024-12-02 - **Last Updated**: 2024-12-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # LuaGui [![Android Build Status](https://github.com/wxaxiaoyao/LuaGui/workflows/Android/badge.svg)](https://github.com/wxaxiaoyao/LuaGui/actions?query=workflow%3AAndroid) [![iOS Build Status](https://github.com/wxaxiaoyao/LuaGui/workflows/iOS/badge.svg)](https://github.com/wxaxiaoyao/LuaGui/actions?query=workflow%3AiOS) [![Linux Build Status](https://github.com/wxaxiaoyao/LuaGui/workflows/Linux/badge.svg)](https://github.com/wxaxiaoyao/LuaGui/actions?query=workflow%3ALinux) [![macOS Build Status](https://github.com/wxaxiaoyao/LuaGui/workflows/macOS/badge.svg)](https://github.com/wxaxiaoyao/LuaGui/actions?query=workflow%3AmacOS) [![Windows Build Status](https://github.com/wxaxiaoyao/LuaGui/workflows/Windows/badge.svg)](https://github.com/wxaxiaoyao/LuaGui/actions?query=workflow%3AWindows) [![Web Build Status](https://github.com/wxaxiaoyao/LuaGui/workflows/Web/badge.svg)](https://github.com/wxaxiaoyao/LuaGui/actions?query=workflow%3AWeb) һ��ʹ��Lua��д�Ŀ�ƽ̨GUIӦ�ÿ��. ## vcpkg - 环境变量设置: ``` VCPKG_DEFAULT_TRIPLET: x64-windows-static VCPKG_ROOT: D:/program/vcpkg ``` ## 常见问题 - __imp_GradientFill 无法解析 `#pragma comment(lib, "MSIMG32.LIB ")` ## TODO [ ] android 绘制文本x,y坐标不能为负数, 为负数文本绘制失效 # lui ## 介绍 Lua UI, Lite UI ### 软件架构 软件架构说明 ### 安装教程 #### window 1. 安装 vcpkg 包管理器, vcpkg 命令添加至环境变量 2. vcpkg 与 vs 集成 2.1 vcpkg integrate project 2.2 添加包源 vs->工具->nu get包管理器->程序包管理器设置->nu get 包管理器->程序包源->添加源 vcpkg\scripts\buildsystems->更新, 确定 2.3 vs 项目属性->管理nuget程序包->程序包源 vcpkg->浏览标签, 安装 3. 安装C++库 (https://ghproxy.com/) 3.1 绘图库 vcpkg install cairo --triplet=x86-windows-static 3.2 字符转码库 vcpkg install libiconv --triplet=x86-windows-static 3.3 日志库 vcpkg install spdlog --triplet=x86-windows-static 3.4 Lua 库 vcpkg install lua --triplet=x86-windows-static 3.5 Lua 绑定库 vcpkg install luabridge --triplet=x86-windows-static 3.6 XML 解析库 vcpkg install tinyxml2:x86-windows-static 3.7 加密解密算法库 vcpkg install cryptopp:x86-windows-static 3.8 异步库 vcpkg install libuv:x86-windows-static 3.9 Curl vcpkg install curl:x86-windows-static 4. 链接静态库设置 4.1 vs 项目属性->C/C++-> 所有选项 -> 运行库->MTD 4.2 vs 项目属性->vcpkg->使用静态库->是 4.3 vs 项目属性->C/C++->语言->C++标准库->c++17 (linux -std=c++17) 5. 编译, 运行 #### linux ##### 编译环境 GCC11.2.0 C++17 1. `wget https://mirrors.aliyun.com/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.gz` 2. `tar -vxf gcc-11.2.0.tar.gz` 3. `cd gcc-11.2.0` 4. `./contrib/download_prerequisites` 5. `mkdir build && cd build && ../configure --disable-multilib` 6. `make` 7. `make install` 8. 指定cmake编译器 `export CC=/usr/local/bin/gcc`, `export CXX=/usr/local/bin/g++`, `export LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH` (gcc11.2.0的位置) #### 库依赖 1. `vcpkg install spdlog:x64-linux` 2. `vcpkg install cryptopp:x64-linux` 3. `vcpkg install lua:x64-linux` 4. `vcpkg install luabridge:x64-linux` 5. `vcpkg install tinyxml2:x64-linux` 6. `vcpkg install libuv:x64-linux` 7. `vcpkg install libiconv:x64-linux` 8. `vcpkg install cairo:x64-linux` 9. `vcpkg install curl:x64-linux` #### Andorid 1. 设置NDK环境变量 `export ANDROID_NDK_HOME=D:\ProgramData\Android\Sdk\ndk\23.1.7779620`; 2. 安装库依赖, 示例: `vcpkg install lua:arm64-android` #### VCPKG & CMAKE ```makefile # 工具链文件必须放在project指令前 set(CMAKE_TOOLCHAIN_FILE ${VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake CACHE STRING "Vcpkg toolchain file") # 项目名称 project(main) # 添加自定宏 #add_definitions(-D LINUX) ``` #### 开发约定 - lua 默认编码为 utf8 - c++ 默认编码为 unicode(wchar_t) utf8(char) #### 问题 [x] window 添加预处理宏定义 WIN32_LEAN_AND_MEAN 解决 winsock.h winsock2.h 冲突编译错误 [x] luasql `apt install libmysqlclient-dev; apt install luarocks; luarocks install luasql-mysql;` #### debug ``` --asset_directory="D:\\workspace\\c\\lui\\assets" --logfile="D:\\workspace\\c\\lui\\log.txt" ```