Profile

Member Since
June 09, 2012

Search Members

  

ondesic

8
@

Badges

This user hasn't earned any badges yet.

Posts

Viewing 1 to 8 (8 Total)

Re: How do I create this effect?

Vj3k0,

Thanks for taking the time with me to figure this out. In HTML5 your code creates an image that looks exactly like overlay.png. The pixels aren't merging, overlay.png is taking over.

Also, remember what I am trying to create is a hole in the picture, not a black spot. If done correctly, the color of the spot in the middle will be the background color. I hope that makes sense.

Posted on June 14, 2012 at 7:16 AM

Re: How do I create this effect?

I just want to know how to get the effect. Nothing im doing works.

Posted on June 13, 2012 at 7:44 AM

Re: How do I create this effect?

Vj3k0,

Thank you for your help. I am afraid you lost me in the middle. If it is not too much trouble, could you show me in code?

Thanks so much!!

Posted on June 12, 2012 at 3:00 PM

Re: How do I create this effect?

This is a modified version of the AddingAnimation code by Joshua Granick

package;

import jeash.display.BitmapData;
import jeash.display.BlendMode;
import jeash.RGB ;
import nme.display.Stage;
import nme.display.Bitmap;
import nme.display.Sprite;
import nme.display.StageAlign;
import nme.display.StageScaleMode;
import nme.events.Event;
import nme.Assets;
import nme.Lib;
import jeash.geom.Rectangle;
import jeash.geom.Point;

class AddingAnimation extends Sprite {

private var logo:Bitmap;
private var sphere:Bitmap;
private var sphereBMD:Bitmap;

public function new () {
super ();
addEventListener (Event.ADDED_TO_STAGE, this_onAddedToStage);
}

private function construct ():Void {
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;

sphere = new Bitmap(Assets.getBitmapData ("assets/hole.png"));
sphereBMD = new Bitmap(Assets.getBitmapData ("assets/mask.png"));
logo = new Bitmap (Assets.getBitmapData ("assets/nme.png"));

sphere.SetMask(sphereBMD);
logo.x = (stage.stageWidth - logo.width) / 2;
logo.y = (stage.stageHeight - logo.height) / 2;

logo.bitmapData.copyPixels(sphere.bitmapData, new Rectangle(0, 0, 150, 150), new Point(10, 10),sphere.bitmapData,new Point(0, 0),false);
addChild (logo);

}

// Event Handlers

private function this_onAddedToStage (event:Event):Void {
construct ();
}

// Entry point
public static function main () {

Lib.current.addChild (new AddingAnimation ());

}
}

The images are attached.

Attachments: nme.png hole.png mask.png
Posted on June 12, 2012 at 11:04 AM

Re: How do I create this effect?

Darn, it doesn't seem to matter what code I use. Whether I change the logo's blendmode, mask, mergealpha, etc. The picture looks the same every time (nme3.Pgm in above post) sad

Posted on June 12, 2012 at 12:18 AM

How do I create this effect?

Ok, I want to take the nme logo and put a spherical hole in the center that shows the background. So if the background was black, the black would show through. I am currently using two images and using bitmapData.copyPixels. The problem is, the tranparent image I draw over the logo completely replaces the logo. I hope this makes sense. The first pic is whatI want, the second is what I am getting.

I'll try to add the code when I get home.

Attachments: nme2.png nme3.png
Posted on June 11, 2012 at 7:24 PM

Does NME support Drawing to a target?

I have been looking at Monkey (http://www.monkeycoder.co.nz) and Gideros to use to port my next game. However, neither of these environments support direct drawing to an image (rendering to a specified target). Does NME support this?

Posted on June 09, 2012 at 7:33 PM

More tutorials?

I just happened upon nme yesterday. It took me a while to get everything up and running, but only a couple minutes to get through the examples. I then went through the whack a mole tutorial.

With so many functions, I don't think I could possibly figure everything out (with also trying to learn haxe). Are there more tutorials to help me get a good grasp on nme?

Posted on June 09, 2012 at 2:04 PM