bitmap scrolling (panorama)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

bitmap scrolling (panorama)

Maciej Sawicki
Hi,
I'm just starting with Haxe and flash. I'm sorry for my English, but
I'm not native speaker.

I'm trying to make very simple 360 degree panorama viwer. But I have
to problems:
1. i cant set zoom level to match my website layout (I'm not sure is
it flash or HTML fault).
2. i can set zoom level manully (right click and zoom in), but then my
animation looks strange on the end of the image.

I cant describe it better. Could You look at my website
(http://sawicki.nu/beta/test.html), and test yourself? .

And here is the code:

import flash.display.MovieClip;
import flash.display.BitmapData;

class PanoJpgData extends BitmapData
{
    public function new()
    {
        super(0,0);
    }
}

class SwfImport
{

        static function main ()
        {
        var dx=1.0;
        var i=0;
        var select = true;
        var bitmapData = new PanoJpgData();
        var p1 = new flash.display.Bitmap(bitmapData,
flash.display.PixelSnapping.AUTO, true );
        var p2 = new flash.display.Bitmap(bitmapData,
flash.display.PixelSnapping.AUTO, true );

       
        flash.Lib.current.addChild(p1);
        flash.Lib.current.addChild(p2);
       
        p2.x=p1.width;


        var timer = new haxe.Timer(10);
        var move =function(){
                p1.x-=dx;
                p2.x-=dx;
                ++i;
                if(i==p1.width){
                        if(select)
                                p1.x=p2.width;
                        else
                                p2.x=p1.width;
                        select=!select;
                        i=0;
                        }
                };
        timer.run=move;
    }
}

TIA for help.

Cheers,
--
Maciej Sawicki

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: bitmap scrolling (panorama)

Ian Liu Rodrigues
You can set the height property of your Bitmap:

p1.height = flash.Lib.current.stage.stageHeight;

This would fit the bitmap height to your Flash height.
Don't know if this is what you want.

Ian L.

On Tue, Oct 28, 2008 at 7:53 PM, Maciej Sawicki <[hidden email]> wrote:
Hi,
I'm just starting with Haxe and flash. I'm sorry for my English, but
I'm not native speaker.

I'm trying to make very simple 360 degree panorama viwer. But I have
to problems:
1. i cant set zoom level to match my website layout (I'm not sure is
it flash or HTML fault).
2. i can set zoom level manully (right click and zoom in), but then my
animation looks strange on the end of the image.

I cant describe it better. Could You look at my website
(http://sawicki.nu/beta/test.html), and test yourself? .

And here is the code:

import flash.display.MovieClip;
import flash.display.BitmapData;

class PanoJpgData extends BitmapData
{
   public function new()
   {
       super(0,0);
   }
}

class SwfImport
{

       static function main ()
       {
       var dx=1.0;
       var i=0;
       var select = true;
       var bitmapData = new PanoJpgData();
       var p1 = new flash.display.Bitmap(bitmapData,
flash.display.PixelSnapping.AUTO, true );
       var p2 = new flash.display.Bitmap(bitmapData,
flash.display.PixelSnapping.AUTO, true );


       flash.Lib.current.addChild(p1);
       flash.Lib.current.addChild(p2);

       p2.x=p1.width;


       var timer = new haxe.Timer(10);
       var move =function(){
               p1.x-=dx;
               p2.x-=dx;
               ++i;
               if(i==p1.width){
                       if(select)
                               p1.x=p2.width;
                       else
                               p2.x=p1.width;
                       select=!select;
                       i=0;
                       }
               };
       timer.run=move;
   }
}

TIA for help.

Cheers,
--
Maciej Sawicki

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: bitmap scrolling (panorama)

Maciej Sawicki
On Wed, Oct 29, 2008 at 3:56 AM, Ian Liu <[hidden email]> wrote:
> You can set the height property of your Bitmap:
>
> p1.height = flash.Lib.current.stage.stageHeight;
>
> This would fit the bitmap height to your Flash height.
> Don't know if this is what you want.


Thank You for fast replay. Yes I thin it's that what I need (i was
stupid because i was try to change main (current) movie clip instead
of jpg from the lib).
However since i added this line I've got IO.Bits_error during compilation :-(.

So what I do wrong?

--
Maciek Sawicki

--
haXe - an open source web programming language
http://haxe.org