Hello,
is there a way to make round corner rectangle with krpano in a Div ?
i know we can overlay 4 .png files with the same html background color to mimic this effect,
but is there any other way ?
Thanks
Z.
Hello,
is there a way to make round corner rectangle with krpano in a Div ?
i know we can overlay 4 .png files with the same html background color to mimic this effect,
but is there any other way ?
Thanks
Z.
Hi,
sorry, never tried, but maybe the css borders will work with the wmode="transparent" or wmode="opaqe" flash embedding parameter,
but note - this will reduce the rendering performance,
best regards,
Klaus
You can make round corner rectangles using the textfield plugin where no png files are needed.
Phil
Hi! maybe you can use this way....
Hope this help you....
Regards!
Thanks guys for answering
i've found this other thread as well : Mask question
well, in fact i've found another nice solution with the release of krpano 1.0.8.12,
with the new <area> mode "border" :
let's say my html div is 600x400, i got an interface over krpano (topbar and bottombar 30 pxl height) and i setup my krpano area border distant to 29 pxl up and down, then there nothing under my interace topbar and botombar and i can apply a mask in as3
var rounded_corner_mask:Sprite = new Sprite();
rounded_corner_mask.graphics.beginFill(0x0000FF);
//DrawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
rounded_corner_mask.graphics.drawRoundRect(0,0,stage.stagewidth,stage.stageheight,10,10);
rounded_corner_mask.graphics.endFill();
rounded_corner_mask.x = 0;
rounded_corner_mask.y = 0;
// apply mask to interface :
//this.mask = rounded_corner_mask;
//not forget to setup the mask width and height same as stage for resizing event,
the flash div background color must be the same as html background.
and with a variable and a callback function, i can round the corners on-demand
z
He Zadda,
will publish full code and some more explenation?
Where do you put that as3 code?
Thanx
Tuur
well,
till krpano 1.07, there was inside the demo package,
a folder called plugins-sources/flash-cs3/flashcomponents/ where you can find : flashcs3exampleplugin1.fla
(it seems it's no longer provided, and certainly has been replaced by embbedexample.fla)
so get this .fla,
put in it :
var rounded_corner_mask:Sprite = new Sprite();
rounded_corner_mask.graphics.beginFill(0x0000FF);
//DrawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
rounded_corner_mask.graphics.drawRoundRect(0,0,stage.stagewidth,stage.stageheight,10,10);
rounded_corner_mask.graphics.endFill();
rounded_corner_mask.x = 0;
rounded_corner_mask.y = 0;
// apply mask to interface :
this.mask = rounded_corner_mask;
and you're done
if you want dynamicaly round the corner , via your .xml :
put this in a function :
and 2 solutions to call this function, as far as i know :
1- using attributes :
i don't know, i've tried but fail, because in flashcs3exampleplugin1.fla there no Register and update events, if someone can modify the source, thanks
2- using a callback function :
AS3 in your .fla
krpano.set("corners_state", update_corners);// add a function to krpano, which is callable from xml
//
function update_corners(corners:String):void // function called
{
//
var corners:String = krpano.get("corners");
//
if (corners == "round")
{
//
this.mask = null;
//
}
else if (corners == "no_round")
{
//
this.mask = rounded_corner_mask;
//
}
}
Alles anzeigen
and in your .xml, the variable by default :
that's all folks
z
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!