Button in creator have border when hover in canvas mode render (web)

Hi all

I use button with transition in cocos creator.
But everytime my mouse over button. Button have black border like image below.
Anyone know how to fix this.
Thank !

I experienced the same thing, but only in Browser/Canvas mode. My buttons have no transition at all.

Best regards,
Zsolt

@PZsolt27 Do you know how to fix this ?
@nantas2 @pandamicro Can you help me.

Unfortunately I did not find any solution yet… :frowning:

I am not sure if this is your problem, but if your button sprite is packed into one big atlas or sprite sheet. Try to have the border between each image at least 2px

Thank you. I try add 2px border with Texture Packer but this issue still persists.

The upper button has the strange effect, when I move the mouse cursor over it. It has scale transition effect, and the Hover Sprite Frame is “none”.

if(cc._renderType === cc.game.RENDER_TYPE_CANVAS){
cc.renderer.enableDirtyRegion(false);
}

fix this issues :smiley:

I get the following from the Simulator:

Simulator: 541:TypeError: cc.renderer is undefined

And from the Chrome browser:

Uncaught TypeError: cc.renderer.enableDirtyRegion is not a function

Sorry. Use cc._renderType :smiley:
if(cc._renderType === cc.game.RENDER_TYPE_CANVAS){
cc.renderer.enableDirtyRegion(false);
this.renderType.string = ‘Canvas’;
}

1 Like

Thanks, it works now! :slight_smile: