AntKarlov / Anthill-Framework

Tiny framework for creating Flash games.
57 stars 16 forks source link

Mask and Mouse #2

Closed jackhsu closed 11 years ago

jackhsu commented 11 years ago

Hi ,

Thank you so much for making such a wonderful game API. I have some questions when using anthill framework. Sorry for my English , I don't know Russian either. And here are my 2 questions:

Is there a way to implement the mask to mask the actor?

If the game is loaded from another larger swf and it's position is not set as the top left of the loader swf, the ant button's clicking region will be off the correct position. Is there a way to avoid this ?

Thank you so much and wish you have a wonderful day.

AntKarlov commented 11 years ago

Hi,

Now in the Anthill no opportunities to create dynamic masks. But you can use the classic mask in Flash IDE in MovieClips before they are rasterized to bitmaps. Let me know about your tasks for which you need a mask - maybe I can give you a solution?

I do not really understand the essence of the problem you described in the second question. Would be great if you send me a sample so that I could clearly see the problem. My email: ant.anthill@gmail.com

Thank you for feedback!

jackhsu commented 11 years ago

Hi ,

Sorry for later reply .

I will send you a mail .but I think it would be much easy to just write a simple code here.

Just write a loader swf with the following code:

package { import flash.display.Loader; import flash.display.Sprite; import flash.net.URLRequest;

[SWF(width="800", height="480", backgroundColor="#FFFFFF")]

public class TestLoader extends Sprite
{
    public function TestLoader()
    {
        var loader:Loader=new Loader();
        loader.x=90;
        loader.y=0;
        addChild(loader);
        loader.load(new URLRequest("AnthillExamples.swf"));
    }

}

}

Notice that the swf is a little larger than the loaded swf. And I set it's x position to 90. So when you click the button , you will find the click region is offsetted to the left.

Thank you so much .

jackhsu commented 11 years ago

Just solved this on my side . It's in AntG.as

internal static function updateInput():void { mouse.update(stage.mouseX,stage.mouseY); keys.update(); updater.update(); }

I have changed mouse.update(stage.mouseX,stage.mouseY); into mouse.update(_anthill.mouseX,_anthill.mouseY); And loaded swf works well.

For the mask . It's a good way to implement it in IDE. But it can't solve when I need to mask an animation loop.I need to work on a bottle full of water. and there's an animation of fluid in the bottle. the fluid is raising controlled by the code. In this way , preprocess the mask in IDE will make the water become still.

AntKarlov commented 11 years ago

Hi,

Good solution for the mouse issue! :) In the Anthill version 0.3.0 added support for animated masks.

Thank you for the feedback!