0 Favourites

Web Gallery

  • It is possible to make a gallery with construct2 like this one???

    http://www.jstyler.net/

    for example, if in my ftp i have a folder imgs where i drag and drop jpg files and its updated in the construct2 app when its hosted on my ftp?

    Its is possible to make that kind of gallery?

    thanks

  • no one?

  • Yes, pretty much, minus the ability to read a directory without some server side script.

    That would be reinventing the wheel tho... Might do a search for free gallery scripts. I'm sure there's literally hundreds.

  • yeah i know :s its like reinventing the wheel, but im really curious about construct2 if this kind of stuff can be developed with this engine, its allways good to think far than just games.

    and i have buy my licence to learn first this engine, and after for creating web apps or games. <img src="smileys/smiley17.gif" border="0" align="middle" />

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • imageViewer.capx

    A basic example with Canvas plugin

    you need to put a file named list.txt in the folder IMAGE_FOLDER (by default 'gallery') relative to your index.html

    In this file, you should have the list of images like that:

    myImage1.jpg
    myImage2.jpg
    myImage3.jpg
    ...[/code:2yju6fwg]
    they should be in the same folder as list.txt
    
    Then it should work like that:
    
    with list.txt
    
    Using canvas was the only way to avoid reloading the image each time since you can't have different texture per instances of a sprite.
    The alternative idea was to set enough blank frames in the image sprite and load your image in each of them.
    But using canvas you can have any number of images, you'll just have to upload images and update list.txt without having to worry about re-exporting a capx.
    
    And if you need a php script for automatic listing, that should be enough:[code:2yju6fwg]<?php
    $imageDirectory = '.';
    $allowedExtensions = 'png,jpg,gif,bmp';
    
    $dir = opendir($imageDirectory);
    $ext = explode(',',$allowedExtensions);
    
    if ($dir) {
        while (false !== ($entry = readdir($dir))) {
             $info = pathinfo($entry);
             if (in_array($info['extension'],$ext)) {
                echo "$entry\n";
            }
        }
        closedir($dir);
    }
    ?>[/code:2yju6fwg]Yann2013-02-09 21:51:05
  • yeaaaaaaaaaaah :D fantastic loool :D thanks yann :D that prove its very possible, now a question the gallery you made is very good, but you think its possible betwen each picture its possible to add a fade effect??

    picture 1 when clic fade to picture 2 etc :D

  • easy peasy... updated

  • niiice lool :D i supose if we want the fade effect more "fluid" it just need to be accelerated?

  • this, <?php

    $imageDirectory = '.';

    $allowedExtensions = 'png,jpg,gif,bmp';

    $dir = opendir($imageDirectory);

    $ext = explode(',',$allowedExtensions);

    if ($dir) {

        while (false !== ($entry = readdir($dir))) {

            $info = pathinfo($entry);

            if (in_array($info['extension'],$ext)) {

                echo "$entry\n";

            }

        }

        closedir($dir);

    }

    ?>

    have to be added into the capx?

  • That's php.

    If you have a server that runs php you can create a file name for instance

    list.php

    you copy/paste this code in it

    you put this file where the images are

    and you modify event 2 to call list.php instead of list.txt

    The php script will just look into the folder it is in, list all the files with extension, png, jpg, gif, or bmp like they are in list.txt (one file by line)

    It's just more automatic. It facilitate update since you'll just have to add images in the folder.

    However you'll have no control over ordering. (I don't know if the script orders alphabetically, or by date of modification...)

  • yeaaaaaaaaaah thanks again for all your great help :D <img src="smileys/smiley41.gif" border="0" align="middle">

    result :D

    http://mattepainting.be/test/index.html

  • Hey neat art :D

  • thanks :D (the prime pictures present in the gallery you made ar not mine, only mattepainting.be are my different works).

  • dl.dropbox.com/u/23551572/C2/imageViewer.capx

    you need to put a file named list.txt in the folder IMAGE_FOLDER (by default 'gallery') relative to your index.html

    ?>

    Hi there, thanks for your help. But can u show me how to relative Image folder to your capx :( ? Just put it in same place with capx file doesn't work <img src="smileys/smiley19.gif" border="0" align="middle" /> . And can I make a image viewer apps with this sample ? :D

  • Yann Sorry, exactly how do you use the canvas plugin here? I still don't get that part.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)