2005.2.221 When you need to make a thing in a set of buttons, this is relatively simple, don't need to use some behaviors that need to be used, we can do this; a universal behavior, behavior through Do Call another function. Then we write this function in the movie script. So we can greatly reduce the number of behaviors. And the better way should set a function in the parent script, so this function is packaged, Can't access globally, therefore is more secure.
2005 2 28 In the production of mathematical tools for the form, we package the data in a global object, the global object is generated by a parent script, which is generated, destroyed, reset, read, etc., then set a behavior. By setting the properties, we can make different texts to read different global variables, which is convenient for the entire program layout.
He is usually doing this. First initialize a series of global objects, such as globalization of a Text object, when there is a text, you can call a series of functions through this global object. This is packaged. A series of functions are also convenient for calling and understanding these functions.
The object can be nested at the same time. EG: Parent: Aaronon New Me Ptext = Empty Leio = New (Script "leio") EndRect object is used to set the elf's Rect property. Set, read, and wait a series of behaviors Object. By initializing a series of RECT objects, we can keep some information in global variables.
20050302 How to collect similar elves. First, we need a behavior, then set the same group of flags when it is initialized. For example, it is playid, and we set up an array urgroupid. Then use SendallSprite. Event, OURID, OURGROUPID sends information to all the elves. Then collected in the EVENT event, like this: on beginsprite me oorgrouplist = [] sendallsprite (# Gather, Ourid, OurGroupList) endon Gather Me, Pourid, PourGroupList if Pourid = Ourid THEN OURGROUPLIST = POURGROUPLIST OURGROUPLIST.APpend (ME) End ifreturn PourGroupListenD So all the wits are collected in a number ancestor, then we can use the call (# Event, urgrouplist, para) to use functions without need Global Capture Call Function. Save resources.
Specific analysis of a public polymorphic behavior Here we figure out two points: 1 Elf message transmission is from low channels to high channels. At the same time, the initialization of the elves is also low-channel prayer channels. At low channel Beginsprite to high channels Send a message, the high channel is not accepted because he has not initialized by Beginsprite.
2 If a array variable is passed in the parameter, it is actually shared by this array variable in two behaviors, which is actually a variable in attributes and global variables.
How to display the corresponding list according to the MEMBER attribute of the elves! Take a look at this program .on getpropertydescriptionList meplist = [:] Case Sprite (the currentsprite) .member.type of "text": selelist = [# a, # b] "Field: SELELIST [# C, # D] end cassetaprop plist, # pwhatitem, [# time:"
20050308 About SendallSprite mechanism. SerouldallSprite is not as simple as sending messages, he can also return the value. In fact, he is traversing all the elves to call the corresponding behavior function. And you can also receive the value returned by the behavior function. An application is: if Your behavior has a set of elves, you want to find a specific elf to let all the elves know his channel. Do this. First set the value of PTYPE in GetPropertyDescriptionList, then then this. On Beginsprite Me Pnum = Sendallsprite (#getmoviespritenum) Endon getMoviespritenum ME.SPRITENUM END IFEND This package will return to Movie's number of channels, and all the wizards of all the acts have been issued The news, so they all have a message. The key is to set the wizard of the channel set to MOVIE, should be placed at the bottom of all behaviors. Otherwise, there may be a elich may have not been able to initialize it, so Do not receive Message. Do not get the correct value. IMAGE LINGO basic one image object = image (100, 100, 8, #grayscale) i = member (1, 1) .image i = member (1, 1). Picturei = (The Stage) .ImageSprite (1) .Image The above five ways, but generally do not use the Picture property.
The two Color objects are the most basic case: c = color (# RGB, 255, 255, 255) can also be written: c = RGB (255, 255, 255) c = RGB ("ffffff") c = color (# PaletteIndex, 0) c = PaletteIndex 0) We can use some programs to convert color data conversion. Like this on CMYK RGBVAL CYAN = (255 - rgbval.red) / 255.0 Magenta = (255 - rgbval.green) / 255.0 Yellow = (255 - rgbval.blue) / 255.0 Black = min ([Cyan, Magenta, Yellow]) cmykval = [#cyan: cyan, #magenta: Magenta, #yellow: Yellow, #black: black] Return CMYKVAL END. We can also provide from existing data. Color object. such as; c = member ("text met"). Colorc = Sprite (1) .forecolorc = i.getpixel (10, 10)
Two very useful commands GetPixel and SetPixel