luavgl icon indicating copy to clipboard operation
luavgl copied to clipboard

ToDos

Open XuNeo opened this issue 2 years ago • 10 comments

  • [x] obj:anim rework to use uservalue table instead of C arrays.
  • [x] obj:anim add done_cb support, so application knows when anim is done.
  • [x] use pcall instead of call in obj event, like luv
  • [x] unified set/get methods
  • [ ] auto code generation for widget
  • [x] add documentation for newly added functions

XuNeo avatar Feb 28 '23 11:02 XuNeo

call_protectedcall lua_result call_flappyBird lua_result This is the error I encountered when executing protectedcall.lua and flappyBird.lua respectively. Is this a problem with my environment? I initially used Lua version 5.4.4.

LinZeb906791229 avatar Mar 20 '23 05:03 LinZeb906791229

call_protectedcall lua_result call_flappyBird lua_result

This is the error I encountered when executing protectedcall.lua and flappyBird.lua respectively. Is this a problem with my environment? I initially used Lua version 5.4.4.

Based on the analysis of the code in flappyBird.lua, it seems that the image file "pipe_up.png" has not been successfully opened or loaded. This can be seen from the fact that when printing the values up.h and up.w, they are both nil which indicates that the image dimensions have not been set.

LinZeb906791229 avatar Mar 20 '23 06:03 LinZeb906791229

The protectedcall demo is designed to crash in 1second, it shows the ability to print call stack on screen.

However the flappyBird should not crash. I have adjusted the image path days ago, you may need to update the code and recompile again.

XuNeo avatar Mar 20 '23 07:03 XuNeo

The protectedcall demo is designed to crash in 1second, it shows the ability to print call stack on screen.

However the flappyBird should not crash. I have adjusted the image path days ago, you may need to update the code and recompile again.

Thank you for your reply.I have solved the issue I was having. I am currently using Windows' QT5.14 simulation and I resolved the issue by making the following two modifications:

1-For LVGL's FS in QT, "LV_FS_WIN32_LETTER" and "LV_FS_WIN32_PATH" must be defined as the first letter of the user's home directory. This can be seen from the "lv_fs_get_drv" function where it performs a letter comparison. Since my home directory is "./examples", both paths must be set to ".".

2-In the "flappyBird.lua" example, the code "IMAGE_PATH = IMAGE PATH .. "/flappyBird/"" must be written as "IMAGE_PATH = IMAGE_PATH .. "flappyBird/"", otherwise an extra "/" symbol will be added to the "IMAGE PATH" concatenation.

LinZeb906791229 avatar Mar 20 '23 11:03 LinZeb906791229

The current code is only suitable for embedded devices with large memory capacities. When running on a microcontroller with built-in SRAM of 128K and external SDRAM of 8M, loading the Flappy Bird demo image consumes a significant amount of memory. Do you have any suggestions regarding image processing? If we open the image using a C library and save the pointer to the opened image data, could we then pass the image pointer to the Lua virtual machine to reduce heap memory usage by Lua? I just started learning Lua last week and I have a limited understanding of it.

LinZeb906791229 avatar Mar 21 '23 03:03 LinZeb906791229

The current code is only suitable for embedded devices with large memory capacities. When running on a microcontroller with built-in SRAM of 128K and external SDRAM of 8M, loading the Flappy Bird demo image consumes a significant amount of memory. Do you have any suggestions regarding image processing? If we open the image using a C library and save the pointer to the opened image data, could we then pass the image pointer to the Lua virtual machine to reduce heap memory usage by Lua? I just started learning Lua last week and I have a limited understanding of it.

In order to make Lua run on my microcontroller, I made some modifications to the Lua system to adapt it, and I finally managed to run all the demo except for Flappy Bird. However, running Flappy Bird still leads to a HardFault.

LinZeb906791229 avatar Mar 21 '23 03:03 LinZeb906791229

All the images in examples are png, change them to lvgl bin format and use indexed_8 will reduce memory significantly. Don't forget to update lua file with correct file extension name.

When hardfault occurs, try to get a backtrace or simply which piece of code causes it, so can do further analysis.

XuNeo avatar Mar 21 '23 05:03 XuNeo

For images that need transformation, use lvgl true_color_alpha format, do not use indexed_8 which is not supported. Images include: the bird, the score result backgroud etc.

XuNeo avatar Mar 21 '23 05:03 XuNeo

For images that need transformation, use lvgl true_color_alpha format, do not use indexed_8 which is not supported. Images include: the bird, the score result backgroud etc.

I am currently attempting to convert the image data to a bin file format utilizing the RGB555 TrueColor specification. I would like to express my gratitude once again for your assistance.

LinZeb906791229 avatar Mar 21 '23 06:03 LinZeb906791229

You can try to modify this definition

VeryCapture_20240117160536

jinsc123654 avatar Jan 17 '24 08:01 jinsc123654

set/get now using property API.

https://github.com/XuNeo/luavgl/pull/50

XuNeo avatar Aug 04 '24 08:08 XuNeo