Jump to content

Little Label Intro


UEZ
 Share

Recommended Posts

I played around with label and this is the result:

#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, AutoIT.bmp, bitmap, Backround_PIC, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, DRAX - Space Whale.xm, rcdata, Audio_1, 0
#AutoIt3Wrapper_Run_After=ResHacker.exe -add %out%, %out%, BASSMOD.dll, rcdata, DLL_1, 0
#AutoIt3Wrapper_Run_After=upx.exe --best --compress-resources=1 "%out%"
;#AutoIt3Wrapper_run_after=upx.exe --ultra-brute --compress-resources=1 "%out%" ;very slow
#include "Resources_Mod.au3"
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>

Opt("GUIOnEventMode", 1)
Opt('MustDeclareVars', 1)
Opt("TrayIconHide",1)
HotKeySet("{Esc}","Quit_Intro")

Global $BASSDLL, $window, $backround, $font, $fontsize, $label1, $string, $Load, $test_GUI
Const $start_x = 0
Const $start_y = 0
Const $end_x = 300
Const $end_y = 172
Const $center_x = @DesktopWidth / 2
Const $center_y = @DesktopHeight / 2



Intro_I()

Func Intro_I()
    Play_Audio()

    Local $text =  _
                    "" & @CR & _
                    "Small Label Intro"  & @CR & _
                    "--------------------------------------------------------------------------" & @CR & _
                    "This is just a simple, small label intro" & @CR & _
                    "Created with AutoIT using BASSMOD.DLL" & @CR & _
                    "For playing XM tune created by DRAX from" & @CR & _
                    "Maniacs of Noise" & @CR & _
                    "" & @CR & _
                    "Coding done by UEZ for AutoIT forum and its users ;-)" & @CR & _
                    "" & @CR & _
                    "Greetings to all AutoIT forum users and especially" & @CR & _
                    "To the guys who support all users!"  & @CR & _
                    "" & @CR & _
                    "" & @CR & _
                    "Press ESC to quit ;-)" & @CR & _
                    ""

    $window = GUICreate("Intro_I ;-)", $start_x, $start_y, $center_x, $center_y, BitOR($WS_SYSMENU,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS), $WS_EX_TOPMOST)

    $backround = GUICtrlCreatePic("",0, 0, $start_x, $start_y)
    _ResourceSetImageToCtrl($backround, "Backround_PIC", $RT_BITMAP)
    
    GUISetOnEvent($GUI_EVENT_CLOSE, "Quit_Intro")

    $font = "MS Sans Serif"
    $fontsize = 14
    GUISetFont($fontsize, 400, -1, $font)
    $label1 = GUICtrlCreateLabel($text, 1000, 1000, -1, 400, $SS_CENTER, BitOR($WS_EX_OVERLAPPEDWINDOW, $WS_EX_TRANSPARENT, $WS_EX_LAYERED, $WS_EX_DLGMODALFRAME, $WS_EX_TOPMOST))
    GUICtrlSetBkColor($label1, 0xFCFEFC)
    GUISetState()
    
    Local $pi = 3.1415926535897932
    Local $y = $end_x
    Local $rand1 = 0
    Local $rand2 = 0
    
    While $rand1 = 0 ;get 1 or -1 for start x position of fly in window 
        $rand1 = Random(-1, 1, 1)
    WEnd
    While $rand2 = 0 ;get 1 or -1 for start y position of fly in window
        $rand2 = Random(-1, 1, 1)
    WEnd
    For $x = $end_x To 0 Step -1 ;let the window fly in using sin and cos
        WinMove($window, -1, $center_x - $end_x / 2 + $x / 2 * $rand1 * Sin($y / $pi ^ 2.75) * 4 , $center_y - $end_x / 2 / ($end_x / $end_y) + $x / 2 * $rand2 *Cos($y / $pi ^ 2.75) * 4  , $end_x - $x, ($end_x - $x) / ($end_x / $end_y), -1)
        $y -= 1
        Sleep(1)
    Next

    Local $i = 90
    While 1
            $i += 0.50
            If $i = 0xFFFFFFFF Then $i = -0xFFFFFFFF ;avoid buffer overflow - I don't know whether this is really needed
            ControlMove($window, -1, $label1, -80 + Cos($i / 3.14159265 ^ 2.75) * 96, -85 + Sin($i / 3.14159265 ^ 3.5) * 256) ;move label in endless loop
            Sleep(40)
    WEnd

EndFunc

Func Quit_Intro()
    For $x = $end_x To 0 Step -1 ;resize window to min
        WinMove($window, -1, $center_x - $x / 2, $center_y - $x / 2 / ($end_x / $end_y), $x, $x / ($end_x / $end_y), -1)
    Next
    GUIDelete()
    If Not (FileExists(@TempDir & "\BASSMOD.dll")) Then
        Exit
    Else
        DllCall($BASSDLL, "int", "BASSMOD_MusicFree")
        DllClose($BASSDLL)
        FileDelete(@TempDir & "\BASSMOD.dll")
    EndIf
    Exit 0
EndFunc

Func Play_Audio()
    If Not FileExists(@TempDir & "\BASSMOD.dll") Then
        _ResourceSaveToFile(@TempDir & "\BASSMOD.dll", "DLL_1") ;extract BASSMOD.dll to script dir if not available
    EndIf

    Global $BASSDLL = DllOpen(@TempDir & "\BASSMOD.dll"), $Init[1]
    $string = _ResourceGetAsString("Audio_1")

    $Init = DllCall($BASSDLL, "int", "BASSMOD_Init", "int", -1, "int", 44100, "int", 0)
    $Load = DllCall($BASSDLL, "int", "BASSMOD_MusicLoad", _
                             "int", True, _
                             "ptr", $string, _
                             "int", 0, _
                             "int", 0, _
                             "int", 4 + 1024)
    $Volume = DllCall($BASSDLL, "int", "BASSMOD_SetVolume", "int", 100)
    DllCall($BASSDLL, "int", "BASSMOD_MusicPlay")
    ;Music flags
    ;BASS_MUSIC_RAMP = 1 ' normal ramping
    ;BASS_MUSIC_RAMPS = 2 ' sensitive ramping
    ;BASS_MUSIC_LOOP = 4 ' loop music
    ;BASS_MUSIC_FT2MOD = 16 ' play .MOD as FastTracker 2 does
    ;BASS_MUSIC_PT1MOD = 32 ' play .MOD as ProTracker 1 does
    ;BASS_MUSIC_POSRESET = 256 ' stop all notes when moving position
    ;BASS_MUSIC_SURROUND = 512 'surround sound
    ;BASS_MUSIC_SURROUND2 = 1024 'surround sound (mode 2)
    ;BASS_MUSIC_STOPBACK = 2048 'stop the music on a backwards jump effect
    ;BASS_MUSIC_CALCLEN = 8192 'calculate playback length
    ;BASS_MUSIC_NONINTER = 16384 ' non-interpolated mixing
    ;BASS_MUSIC_NOSAMPLE = &H400000 ' don't load the samples
EndFunc

Maybe you like it :-) Comments are welcome!

It is dedicated to this forum and its users! Thank you for the great support!

Compiled exe here: 4shared

Source code and additional files here: 4shared

:P UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Yes!!! Very good.

But if you are without space to store files in the forum, click in the link "4shared" in my signature and registry an account for you!

Thanx for your sharing... :P

Thanks for the hint! I created an account and uploaded the compiled exe! I hope download from 4shared.com will work!

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

I add some additional code for the fly in of the window doing it randomly (source code and links updated)!

Comments are welcome! :P

Best regards,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • 2 months later...

where is "Resources_Mod.au3" ?

Edit: ok no need now i managed it. but i think it also needs a dll file. where is it?

Just look in my 1st post last line. There you can find the download link where you can find all needed files for compilation (Intro_I.7z). The compiled exe you can download here: Intro compiled only.

Have fun.

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

This crashes when run on my system...

How does it crash exactly? When you start the compiled exe or when you want to start it directly from SciTE by pressing F5?

You cannot start it via F5 because of the embedded audio! You need to compile it and start the exe afterward!

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Crashes here too. And if you need a good file hoster with direct links and no wait use ripway.com :mellow:

If you want to start it via SciTE by pressing F5 then comment out the line "Play_Audio()" -> ";Play_Audio()"! Then it will start but without playing audio!

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • 1 year later...

If you want to start it via SciTE by pressing F5 then comment out the line "Play_Audio()" -> ";Play_Audio()"! Then it will start but without playing audio!

UEZ

that's very nice demo UEZ, thanks for sharing!

love the audio track as well !!!!

Tschüss!

hench

Link to comment
Share on other sites

How did you find this thread? ;)

This was one of my first AutoIt scripts...

Danke,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Since it's up here again,

Nice demo, I like it. :)

I'm also re-doing my whole minesweeper game.

;)

I'll tell you when it's done.

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...