Announcement

Collapse
No announcement yet.

Quicky Image Question Pls ..

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Quicky Image Question Pls ..

    Im using this code to get the effect shown below in the images so when you click the LMB on the the pic enlarges.....

    Image.SetSize("Image1", 752, 410);
    Image.SetPos("Image1", 21, 22);
    Image.SetVisible("Image2", false);
    Image.SetVisible("Image3", false);
    Image.SetVisible("Image4", false);

    Then im using this code on the RMB to reset the screen....

    Image.SetSize("Image1", 203, 115);
    Image.SetPos("Image1", 50, 114);
    Image.SetVisible("Image2", true);
    Image.SetVisible("Image3", true);
    Image.SetVisible("Image4", true);

    The question is......How can I combine the 2 codes so it works with just the LMB ?
    If its possible at all ? So it would be LMB to enlarge....LMB again to reset..

    Thanks in advance




  • #2
    cougar,

    Use a Boolean flag to control the state. If the image is enlarged, set the flag to false, otherwise set it to true.

    Declare the following in the On Preload of your page

    Code:
    bFullsize1 = true;
    bFullsize2 = true;
    bFullsize3 = true;
    bFullsize4 = true;

    On Click (Image 1 - repeat and change for each other image)
    Code:
    if bFullSize1 = true then
    	bFullSize1 = false;
    	Image.SetSize("Image1", 752, 410);
    	Image.SetPos("Image1", 21, 22);
    	Image.SetVisible("Image2", false);
    	Image.SetVisible("Image3", false);
    	Image.SetVisible("Image4", false);
    else
    	bFullSize1 = true;
    	Image.SetSize("Image1", 203, 115);
    	Image.SetPos("Image1", 50, 114);
    	Image.SetVisible("Image2", true);
    	Image.SetVisible("Image3", true);
    	Image.SetVisible("Image4", true);
    end;
    However you may encounter too much pixelation of your image this way. A simpler method is to have each thumbnail call a separate image.

    For example:

    On Click (of Image1):
    Code:
    Image.SetVisible("Enlarged1");
    On Click (of Enlarged1):

    Code:
    Image.SetVisible("Enlarged1", false);
    Hope this helps,

    Cheers,
    MadDogDean

    Comment


    • #3
      Do what MadDogDean said or you could make it in to a function that checks a size or pos
      Plugins or Sources MokoX
      BunnyHop Here

      Comment


      • #4
        @MadDogDean Ok thanks I will give it a try...

        pixelation should not be a problem because i cheated slightly to avoid that..
        The images in the menu are actually full screen shots that are resized to thumbnails so no matter how large they should still look crystal clear.....Whether that's a good idea or not im not sure ? It appears to work great though.
        I wanted to add a function to download the wallpapers later and was trying just to use the pics the once rather than doubling up on everything hence big pics resized in the menu

        @Kingzooly " or you could make it in to a function that checks a size or pos "
        Could you elaborate slightly pls

        Comment

        Working...
        X