Re: Use an image, or draw functions ?
Posted: Thu Sep 10, 2020 9:12 am
Hi,
I am not trying to start a war with which method is better. I knew that @JackZ would advocate using .png over canvas_draw() . I personally prefer to use .png from and aesthetic point of view. Most times I use a combination of both.
Just so that you can get an idea. This overhead panel that I started then stopped because the panel became available in the premium store and I also decided to build a full hardware cockpit., was done with the intention to run on a RPI and overhead touch screen. When I first did it and tried it on a RPi it would crash the RPi (just would not load) That was because of all the annunciator .png files which made the instrument 3.6MB.
I changed that by doing everything in canvas_draw() baring 20 switch images which take up 65kb. The whole instrument now only takes just over 320kb. with the lua and resources images.
The reason I am showing you this is so that you can see what a difference there is between loading many .png file to doing what Jacques did and also using canvas_draw()
The question you asked is an interesting one. You will not get a right or wrong answer as each has it's pros and cons.
Have fun doing the instrument many times to get the exact look and performance you prefer. You will come across many tricks and shortcuts on how to do the same thing. It is all a learning experience.
Keith
I am not trying to start a war with which method is better. I knew that @JackZ would advocate using .png over canvas_draw() . I personally prefer to use .png from and aesthetic point of view. Most times I use a combination of both.
Just so that you can get an idea. This overhead panel that I started then stopped because the panel became available in the premium store and I also decided to build a full hardware cockpit., was done with the intention to run on a RPI and overhead touch screen. When I first did it and tried it on a RPi it would crash the RPi (just would not load) That was because of all the annunciator .png files which made the instrument 3.6MB.
I changed that by doing everything in canvas_draw() baring 20 switch images which take up 65kb. The whole instrument now only takes just over 320kb. with the lua and resources images.
The reason I am showing you this is so that you can see what a difference there is between loading many .png file to doing what Jacques did and also using canvas_draw()
The question you asked is an interesting one. You will not get a right or wrong answer as each has it's pros and cons.
Have fun doing the instrument many times to get the exact look and performance you prefer. You will come across many tricks and shortcuts on how to do the same thing. It is all a learning experience.
Keith