File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ from unreal_engine import FSlowTask
2+ import time
3+
4+ # Create an FSlowTask object, defining the amount of work that
5+ # will be done, and the initial message.
6+ t = FSlowTask (10 , "Doing Something" )
7+ t .initialize ()
8+
9+ # Make the dialog, and include a Cancel button (default is not to
10+ # allow a cancel button).
11+ t .make_dialog (True )
12+
13+ time .sleep (1 )
14+
15+ for i in range (10 ) :
16+ # Update the progress bar. Note that the first argument is the
17+ # amount of work to be done this frame, not the overall work
18+ # done so far.
19+ t .enter_progress_frame (1 , "Progress Position : {}" .format (i ))
20+ time .sleep (0.2 )
21+
22+ # If there was a cancel button included, we can check if it was
23+ # pressed.
24+ if t .received_user_cancel ():
25+ print ("Cancelled" )
26+ break
27+
28+ t .destroy ()
You can’t perform that action at this time.
0 commit comments