Jump to content

You do it lazy


youknowwho4eva
 Share

Recommended Posts

I made some edits to jrowe's script for his spinning box and instead of continuing to steal his thread I made this one for my new modification. You need Irrlicht to use this. (http://www.box.net/shared/47jcql2vqk) I just changed it up so you can spin the box in the x and y by dragging the mouse on the box, spin the box in the z with shift held down and dragging the mouse, and zoom with control and dragging the mouse up and down. (Hint: to re-square up the box first click on it then hold shift and click on it again)

Oh and I switched the AutoIt logo with the Windows xp setup.bmp so this requires xp, but you can always change that to a bmp of your choice.

#include <GUIConstants.au3>
#include <misc.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>
#include <WINAPI.au3>
#include "IrrlichtPluginUtils.au3"
$dll = DllOpen("user32.dll")

HotKeySet("{ESC}", "Terminate")

#Region - GUI Create
$gui = GUICreate("trans", @DesktopWidth, @DesktopHeight, -1, -1, -1, $WS_EX_LAYERED)
GUICtrlCreateLabel("This is text on a transparent Layered GUI", 10, 10, 200, 20, -1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetTip(-1, "Click label to drag layered window")
$layButt = GUICtrlCreateButton("Button", 10, 40, 40)
GUISetBkColor(0xABCDEF)
_WinAPI_SetLayeredWindowAttributes($gui, 0x010101)
CreateDeviceOnWindow( $gui, $EDT_BURNINGSVIDEO, 10, 10, @DesktopWidth, @DesktopHeight, 32, 0, 0 )
GUISetState()

$Camera = AddCameraSceneNode( 0, 0, 0, -40, 0, 0, 0 )
$Node = AddCubeSceneNode( 30 )
$xp = GetTexture( @WindowsDir & "\system32\setup.bmp" )
SetMaterialTexture( $Node, 0, $xp )
SetMaterialFlag( $Node, $EMF_LIGHTING, 0 )
$Y = 0
$x = 0
$z = 0

#Region - GUI SelectLoop
GUISetStyle($WS_POPUP, -1, $gui)
_WinAPI_SetLayeredWindowAttributes($gui, 0xABCDEF, 255)

While 1
    If _IsPressed("01",$dll) <> 1 Then
    BeginScene( true, true, 0, 171, 205, 239 )

SceneDraw( )
GuiDraw( )

EndScene( )
sleep( 30 )
    $f=0
ElseIf _IsPressed("01",$dll) = 1 Then
    Do
    $f += 1
If $f = 1 Then
    $mousewas = MouseGetPos()
Else
    $mousenow = MouseGetPos()



If _IsPressed("10",$dll) <> 1 and _IsPressed("11",$dll) <> 1 Then
    SetRotation( $Node, $x, $Y, $z )
$x = $mousewas[1] - $mousenow[1]
$y = $mousewas[0] - $mousenow[0]
ElseIf _IsPressed("11",$dll) = 1 Then
    setscale($node,$z,$z,$z)
    $z = $mousewas[0] - $mousenow[1]
    If $z < 0 Then $z = $z - ($z * 2)
        $z = $z / 500
    Else
        SetRotation( $Node, $x, $Y, $z )
$z = $mousewas[0] - $mousenow[0]
EndIf
EndIf   


BeginScene( true, true, 0, 171, 205, 239 )

SceneDraw( )
GuiDraw( )

EndScene( )

sleep( 30 )

Until _IsPressed("01",$dll) <> 1
EndIf
WEnd

Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False)
If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03

If Not $isColorRef Then
$i_transcolor = Hex(String($i_transcolor), 6)
$i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
EndIf
Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages)
Select
Case @error
Return SetError(@error, 0, 0)
Case $Ret[0] = 0
Return SetError(4, _WinAPI_GetLastError(), 0)
Case Else
Return 1
EndSelect
EndFunc;==>_WinAPI_SetLayeredWindowAttributes

Func Terminate()
Exit 0
EndFunc

Giggity

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...