Jump to content

Threading paint before OnLoop


Recommended Posts

Posted

Quick question on multithreading. My script uses a GUI which has two options: What tree type to cut and another dropbown menu for how big of an area you want to cut in. Now when the area size if being adjusted I want to paint it, while the main scriptloop has not started yet. 

How can I implement such a function?

Posted
14 minutes ago, Athylus said:

Quick question on multithreading. My script uses a GUI which has two options: What tree type to cut and another dropbown menu for how big of an area you want to cut in. Now when the area size if being adjusted I want to paint it, while the main scriptloop has not started yet. 

How can I implement such a function?

The onPaint method already runs on another Thread.
The main Script loop is another Thread which starts after the onStart.

Posted

There is nothing that is going to interfere with your GUI. The script hasn't started so if your GUI is open and a user is adjusting the area, the area on minimap will also adjust accordingly.

After the script starts, the thread that draws is separate from the onLoop thread,  there still isn't any interference.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...