![]() And finally, Flash will display the received damage the way we want it.Īs a result, we got a mod displaying dealt damage in the place defined by us, with the message color and font size we want.Then the handler function will pass the information to Flash using the same method.The method "events.onReceiveShellInfo" will inform us about the event of damage dealt to our ship and pass this information to the handler function.Let’s get our ship’s ID using the method "battle.getPlayersInfo".Let’s show the damage in a different place, set a different color, different font type and see how it works. For example, let’s change the way damage from enemy shells is displayed. Let’s try to change the way a certain game effect is displayed. Let’s make the task a little more complicated. And finally, the handler function puts the message about successful work to the log file.The Python file gets a call from Flash using the method "flash.addExternalCallback", calls the handler function.Then the handler function brings the message to the stage and calls a function in a Python file using the method "", but no data is passed in this case.At this time, Flash takes our data using the method "" and passes it to the handler function subscribed to this callback.Now let’s pass the line "Hello World!" to Flash using the method "flash.call".In Main.py, create the event handler "events.onFlashReady" that will report that the Flash file has finished loading and you can transfer information to it.As the mod already has a Flash part, the second file (Main.swf) should also be added to the mod folder (!), where Main.py is located. The mod consists of two files Main.py and Main.swf (a compiled file from the ".as" project).Let’s take the " Hello World! " mod and look at how its Python and Flash parts interact:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |