You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, May 16th 2013, 4:34pm

CROP

Hi forum,

I don't understand and I can't make use of the crop function to place buttons in the control bar. How I get the coordinates of my buttons on my file .png?

Thank for your help *smile*

Umalo

Professional

Posts: 1,048

Location: Osijek, Croatia, EU

  • Send private message

2

Thursday, May 16th 2013, 4:50pm

Here is one example for you:


and code:

Source code

1
<plugin name="gui_ploca_10" url="%FIRSTXML%/_gui/10.png" crop="0|0|60|60" onovercrop="0|60|60|60" x="90" y="85"devices="all" keep="true" preload="false" visible="true" enabled="true" handcursor="true" capture="true" children="true" maskchildren="false" usecontentsize="false"					zorder="0" alpha="1.00" autoalpha="false" blendmode="normal" effect="" smoothing="true" pixelhittest="false"align="topleft" edge="lefttop" ondowncrop="" scale="1" scale9grid="" scalechildren="false" onclick="change_language();"/>


That mean: crop me the image starting from pix 0,0 by width and height of 60px for normal state, and when mouse onover than crop the same width and height but start from 0,60.

With this and explanation from here I think you will get it:
http://krpano.com/docu/xml/#plugin.crop

Short version: crop="x-position|y-position|width|height"
regards
Umalo

3

Thursday, May 16th 2013, 5:03pm

Thank for your reply Umalo *thumbup* I try this

4

Saturday, June 8th 2013, 12:40pm

Hi,

I have a new question about crop *smile*

I have two buttons for sound: a on button and off button. Each button has two colors. How do I do with the sound plugin, when I put the sound on or off, the button changes from on to off or off to on ?

Best regards.

Umalo

Professional

Posts: 1,048

Location: Osijek, Croatia, EU

  • Send private message

5

Saturday, June 8th 2013, 9:38pm

place only on button at start and when clicked turn it off with
set(plugin[on_button].visible,false);
set(plugin[off_button].visible,true);
and turn on the next off_button on same position

set(plugin[on_button].visible,true);
set(plugin[off_button].visible,false);

6

Monday, June 10th 2013, 4:56pm

Thanks for your answer. I don't understand but it doesn't work...

Umalo

Professional

Posts: 1,048

Location: Osijek, Croatia, EU

  • Send private message

7

Monday, June 10th 2013, 6:20pm

Take a look at examples: There is e.g. Fullscreen button that behaves exactly what you want. Two buttons created. Only one is visible at the moment. Every button has own action that is calling.

<layer name="openfs" url="buttons.png" align="left" x="280" crop="280|0|40|40" onovercrop="280|40|40|40" ondowncrop="280|80|40|40" onclick="set(fullscreen,true);" visible="true" />
<layer name="closefs" url="buttons.png" align="left" x="280" crop="320|0|40|40" onovercrop="320|40|40|40" ondowncrop="320|80|40|40" onclick="set(fullscreen,false);" visible="false" />

In this example buttons are turned on/off based on events:

<events name="buttonevents" keep="true"
onxmlcomplete="if(istouchdevice, set_drag_cursor(), set_qtvr_cursor() );"
onenterfullscreen="set(layer[openfs].visible,false); set(layer[closefs].visible,true);"
onexitfullscreen ="set(layer[openfs].visible,true); set(layer[closefs].visible,false);"

You can turn them in your onclik layer events.
I don't know how else to explain. Try by your self. If stuck come with your code (online would be great) example to give you more guidelines.

8

Tuesday, June 11th 2013, 5:12pm

Thank for your help, i try this.