User Tag List

Results 1 to 5 of 5

Thread: create a QR code with clickfusion

  1. #1
    Clicker Fusion 2.5Android Export Module
    hamdi369's Avatar
    Join Date
    Feb 2015
    Location
    Strasbourg France
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    create a QR code with clickfusion

    I had to create QR Code in my project, and few days later, I see another clicker that hav the same problem, so I explain my solutions, maybe it could help ...
    It's the first time a create a Tuto for community so I am not expert..
    Sorry for my bad english practice

    1. With Google API

    simply use WebView, and use this url https://chart.googleapis.com/chart?chs=250x250&cht=qr&chl=the-text-to-code

    it was easy, inappropriate to my project
    I can't customize it's margin size, its correction level, need the WebView object that is not cross platform... (if I want to port my project to IOS...)


    2. With a QR code library


    I use this Qr Code : qr-code.zip
    I think it come from here, but I am not sure...

    donwload this library and symply upload it in your server. (for exemple in your www directory).

    It was possible with this library to create a qr code with the margin and the correction level you want, and then download it in your application .


    For exemple with this PHP script (in the parent directory of the library : www in our exemple) :

    PHP Code:
    <?php 
    include "phpqrcode/qrlib.php";
        include(
    'config.php');
        
    // how to save PNG codes to server
            
    $tempDir "created-qrcode-directory/";
    $input $_POST['input'];
    $file $_POST['file'];
    $codeContents $input;
    // generating     
    QRcode::png($codeContents$tempDir.$fileQR_ECLEVEL_L);
    // end displaying     
    echo 'done';  
    ?>
    In the following application, the GET object send POST data to server , with the text to code (input) and the file name to create (file) to the server.
    When the server is finish to create the QR code in the directory (here the directory is "created-qrcode-directory"; the WebView object download it: Qr-code-solution-A.mfa


    But this solution this solution still was not appropriate for me, because :
    • Webview it's not avaibale for IOS
    • I can't customize the QR code "pixel" for make funny Qr codes...
    • must to download a .png files in the application...


    Create directly a QR code in all clickFusion exporter


    Now I will show you how to create "dinamically" QR code using just Active picture; GET object, and the library (on your server)

    We will use a simple php script that will send the Qr code as an text string where the 1 are qrpixels, and 0 none:

    PHP Code:
    <?
    phpinclude "phpqrcode/qrlib.php";
    $input = $_POST['input'];
     // text output       
    $codeContents = $input;
     // generating     
    $text = QRcode::text($codeContents);
     // displaying          
    echo join("", $text);
    ?>
    for exemple we want to code "hello clickteam community "

    we send it with POST and the GET object and recieve :

    1111111001000100101111111100000101101111011101.... "

    the lengh of the string is 625 then we know the size of the qr code to create √625= 25. (our qr code is 25x25) the next steb is to create a loop that cut this string in lines, (called "lines") and a loop inside this loop that read each cells (called "cells")

    Loop line step 1 : 11111110010001001011111111

    >loop cell step 1 11111110010001001011111111
    >loop cell step 2 11111110010001001011111111
    >loop cell step 3 11111110010001001011111111
    ....
    When all cell are checked of the line 1; the loop line go to line 2 and start a new cells check....

    When the cell are 1 then an action triger, here create the "qr pixel" in a qr matrice using the loop index "Lines" for the Y position and the "cells" for the X position.

    ------------------
    in the following mfa the app a QR generator, you can adapt the code for your project by changing the following parameters :

    Qr-code-solution-B-Solution-B.mfa

    qr-code-solutionB-explain.jpg

    I Pur this parameters in Global Value / string but you can make like you want in your own project.

    qr-code-solutionB-explain2.jpg

    when run application it create the code:

    qr-code-solutionB-done.jpg




    it's not hard to create, and it's an simple way to create it but for exemple by checking the North/South/West/East of each cells you can create very funny and customize qr code like chuckie-cheese-qr.jpg or how-to-make-your-qr-codes-more-beautiful-4432542c99.jpg


    hope this tuto help you


    Notice, if you don't have a server, you can use my php scripts as long is for test and fair use

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleMac Export ModuleUnicode Add-on
    Vantales's Avatar
    Join Date
    Jun 2007
    Location
    Tahiti
    Posts
    249
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Bien joué !! Merci pour le tuto (ouais dsl, je le dis en FR car moi aussi j'ai des difficulté en anglais )

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleMac Export ModuleUnicode Add-on
    Vantales's Avatar
    Join Date
    Jun 2007
    Location
    Tahiti
    Posts
    249
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Salut, il y a moyen de savoir comment tu "customize" les QR-Code ?

  4. #4
    Clicker Fusion 2.5iOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    May 2016
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for this! Solution B looks like it is just what I am looking for. I appreciate you taking the time to write this up!

  5. #5
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)
    Esbol's Avatar
    Join Date
    Jun 2016
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you so much! It helped a lot(1.with_google_api). Hello from Kazakhstan! 2018

Similar Threads

  1. Many lines of code = issues with code firing in order?
    By GamesterX23 in forum Fusion 2.5
    Replies: 4
    Last Post: 5th July 2015, 07:31 PM
  2. "Create new objects" doesn't create a physics object?
    By Literswater in forum Fusion 2.5
    Replies: 0
    Last Post: 12th May 2014, 08:42 PM
  3. Code?
    By Blood_Wist in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 11th October 2008, 10:38 AM
  4. V-Code Generator Source Code
    By LB in forum File Archive
    Replies: 1
    Last Post: 10th March 2008, 08:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •