Zoom-In für Optionen - Hintergrund

  • #1, by WoodyleinThursday, 23. April 2015, 22:08 5 years ago
    Hallo liebe Community,

    ich hätte da mal wieder eine Frage.

    Ich bin gerade dabei ein Hauptmenü zu erstellen (sogar extra große Bildgröße bezüglich des Zooms).

    Man sieht quasi ein Buch mit den Schriftzügen. Standart halt, wie: Spiel starten, Spiel laden oder auch Optionen.
    Nun war die Idee, wenn man auf Optionen klickt, dass das Bild sagen wir 20% ranzoomt und 20° - 30° rotiert auf die zweite Seite des Buches und die Optionen erscheinen dann ganz einfach.
    Wenn man das "zurück" anklickt, passiert es halt nur rückwärts. Es geht wieder zurück.

    Das Problem ist halt nur, wie kann ich dort ranzoomen und leicht rotieren.
    Am allergeilsten wäre natürlich noch, dass dieser Zoom schön leicht drauf zoomt.

    Ich denke mal... wenn es überhaupt möglich ist, muss ich LUA nutzen,
    aber da bin ich wirklich ein Noob, was das angeht.

    Freue mich sehr bei helfenen Beiträgen! :-)

    Newbie

    18 Posts


  • #2, by SubbSaturday, 25. April 2015, 09:07 5 years ago
    Hi Woodylein,

    probier es am Besten mal mit dem ShaderToolkit von Simon. Damit geht alles Mögliche unter anderem auch Zoomen und Rotieren des ganzen Bildschirms:

    http://wiki.visionaire-tracker.net/wiki/Shader_%28CMS%29

    Das "Main Skript" musst du in Visionaire als Definitions-Skript reinkopieren.

    Zum Zoomen und Rotieren gleichzeitig kannst du dann in deiner Aktion die Funktion

    shaderViewport(zoom, x, y, rotation, delay, easing) 
    1
    2


    Steht im Skript alles nochmal detailiert beschrieben. Ansonsten frag einfach nochmal.

    Newbie

    14 Posts

  • #3, by WoodyleinSaturday, 25. April 2015, 21:03 5 years ago
    Hallo Subb!
    Danke für deine Antwort.

    Leider bin ich wohl etwas zu doof, den Skript dort reinzukriegen.

    Unter Skripte habe ich den kompletten Text eingefügt (Ja, es ist ein Definitionsskript).
    Allerdings, wenn ich dann über ein Objekt in der Kulisse es über einen Linksklick per Skript ausführen laufen lasse.
    Passiert nichts.

    Hätte da noch jemand Ideen, woran das legen könnte?

    Newbie

    18 Posts

  • #4, by afrlmeSunday, 26. April 2015, 13:26 5 years ago
    1. add the shader toolkit script to the script section of the editor.

    2. to zoom in: create an execute a script action part & add something like this...
    shaderViewport(1.2, 300, 200, math.rad(45), 3000, easeLinearInOut) -- zoom 1.2x to 300x200 over 3 seconds with 45º rotation value.
    1
    2


    3. to reset: create an execute a script action part & add this to it...
    shaderViewport(1, 0, 0, 0, 3000, easeQuintOut)
    1
    2


    here is the syntax for the function...
    shaderViewport(zoom, x, y, rotation, delay, easing)
    1
    2


    P.S: the rotation value is in radians, which I find a little confusing. It's based on Pi, but you can use degrees by using the math.rad() function to convert degrees to radians as you can see in the examples I posted above.

    Imperator

    6812 Posts

  • #5, by WoodyleinSunday, 26. April 2015, 14:08 5 years ago
    I think, I did it like you say but when I click the object in the game, nothing happens. I'm really sorry, when I'm a bit too stupid...

    So, now I added some screenshots ...

    Newbie

    18 Posts

  • #6, by afrlmeSunday, 26. April 2015, 14:20 5 years ago
    Could you please check the messages.log file please? It's located in c:/users/username/appdata/local... somewhere.

    If you need to find the actual location then, run the game via the vs editor. Press TAB to open up dev console & type:
    exec print(localAppDir)
    1
    2

    press enter, then type PRINT LOG & then press enter again. It will show the messages.log contents, which should now contain an entry with the location to the userdata folder where the config.ini, save games & log files for your project will be stored.

    copy / paste the log content to here. You might need to set log level to info via the VS configuration, if you haven't already done so. Info prints everything which is useful for debugging.

    Imperator

    6812 Posts

  • #7, by WoodyleinSunday, 26. April 2015, 14:34 5 years ago
    So, I think it's this one:

    "14:03:34: Error: Wrong argument type for Argument #1 (expected string)
    "

    Newbie

    18 Posts

  • #8, by afrlmeSunday, 26. April 2015, 15:27 5 years ago
    possibly, but I need the entire log. There's usually a few lines about the same thing. One of them will contain the script name & line number where error occurs.

    Imperator

    6812 Posts

  • #9, by WoodyleinSunday, 26. April 2015, 15:39 5 years ago
    Ah, here it is:


    15:38:20: Engine Version: 4.0.1 (Build 1173 from Build date: Aug 12 2014)
    15:38:20: Time needed for preloading game: 9 msec
    15:38:20: Initializing graphics interface. Surface size: 1920x1080, render size: 1920x1080
    15:38:20: Using Framebuffer with texture.
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: red, green, blue, alpha, depth size: <8, 8, 8, 8, 0>, doublebuffer <0>, accelerated <1>
    15:38:21: Serialization finished. Needed time: 27 ms
    15:38:21: SetupParents finished. Needed time: 0 ms
    15:38:21: SortLinks finished. Needed time: 1 ms
    15:38:21: Interfaces loaded. Needed time: 1 ms
    15:38:21: Font "Schriftart0" (Id: 0): Number of font characters does not match with alphabet. Alphabet has 62 characters, but there are 0 characters in the font picture.
    15:38:21: Font 'Schriftart0' (id: 0) does not have a single character.
    15:38:21: Font "Schriftart" (Id: 1): Number of font characters does not match with alphabet. Alphabet has 62 characters, but there are 0 characters in the font picture.
    15:38:21: Font 'Schriftart' (id: 1) does not have a single character.
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: log:
    15:38:21: Error: Wrong argument type for Argument #1 (expected string)
    15:38:21: [string "- ShadersToolKit -"]:410: Invalid syntax for command shaderUniform
    15:38:21: stack traceback:
    [string "- ShadersToolKit -"]:1858: in function <[string "- ShadersToolKit -"]:1856>
    [C]: in function 'shaderUniform'
    [string "- ShadersToolKit -"]:410: in function '__newindex'
    [string "- ShadersToolKit -"]:685: in function <[string "- ShadersToolKit -"]:1>
    [C]: in function 'xpcall'
    [string "- ShadersToolKit -"]:1: in main chunk
    15:38:21: [string "- ShaderExclude -"]:2: attempt to index global 'game' (a userdata value)
    15:38:21: stack traceback:
    [string "- ShaderExclude -"]:5: in function '__newindex'
    [string "- ShaderExclude -"]:2: in function <[string "- ShaderExclude -"]:1>
    [C]: in function 'xpcall'
    [string "- ShaderExclude -"]:1: in main chunk
    15:38:21: Scripts loaded. Needed time: 39 ms
    15:38:21: Time needed for loading game: 1037 msec
    15:38:22: [string "MainMenue: Objekt0: Linksklick: Skript 'shade..."]:2: attempt to call global 'shaderViewport' (a nil value)
    15:38:22: stack traceback:
    [string "MainMenue: Objekt0: Linksklick: Skript 'shade..."]:5: in function 'shaderViewport'
    [string "MainMenue: Objekt0: Linksklick: Skript 'shade..."]:2: in function <[string "MainMenue: Objekt0: Linksklick: Skript 'shade..."]:1>
    [C]: in function 'xpcall'
    [string "MainMenue: Objekt0: Linksklick: Skript 'shade..."]:1: in main chunk
    15:38:58: C:\Users\Jannik96\AppData\Local/BelticSoftware/Ay Island/

    Newbie

    18 Posts

  • #10, by afrlmeSunday, 26. April 2015, 15:44 5 years ago
    ah.. you need to update Visionaire Studio. You are using an outdated version. The current version is 4.1 build 1177. I believe SimonS updated some of the internal shader related code in the engine, as well as the shader toolkit for VS 4.1.

    Please update & then see if that fixes it.

    Imperator

    6812 Posts

  • #11, by WoodyleinSunday, 26. April 2015, 15:48 5 years ago
    Oh god...
    I'm a bit embarrassed...

    Now, it works fine.

    Thank you very much!

    Newbie

    18 Posts

Write post