Jump to content

Surfer SDL


Xandy
 Share

Recommended Posts

This will be an animation program. It doesn't have an individual save feature for the sources (images) you load or create but it will offer to save your workspace at close and save all sources in the workspace to their nameID.

My point it's not really suitable for use as a graphical editor.

http://www.youtube.com/watch?v=UFMQ070kC0A&feature=youtu.be

It is an example of how to use SDL with AutoIt. There is a handy windowclass and print functions that can be found in includeSDL_Template.au3 and windowclass.au3. Examples of their use can be found in surfer.au3.

It's a mess because I am still learning, but now I can link my questions here to advance my learning.

Concepts a source is a graphic object you load or create. You can draw a source onto a lower layer source.

Change source layer by selecting a source image and mouse wheel up and down.

Controls:

The tip area of the help window displays controls when you mouseover the other windows.

Right-Click window data to change the data.

- Source window

- - colorkey

- - x, y, w, h of source

- - alpha

- - scale numpad +, - also control the scale

- Pen window

- set the color of the pen or press 'G' to get color at mouse

SPACEBAR to drop pen 1 at mouse (must be over a source image), pen 2 cannot be drawn yet

Right-Click a source image for context menu containing options to:

- toggle using the colorkey

- Flip the source image

- Rotate buggy the point to rotate offsets are being applied to to dest drawn, I know how to fix it now.

Works with AutoIt v3.3.8.1, some older versions of AutoIt do not work with the surfer.au3 .

Source on my site. ( LINK )

It includes all of it's dependencies so if you have AutoItObject or SDL_UDF all ready in a shared include you will have to remove the AutoItObject or SDL_UDF from the 'include lib' folder located in the surfer root (not the surfer sub-folder include).

Otherwise it's pickup and go.

;Surfer uses libraries of Human Resource:

; --- AutoIt

; Jonathan Bennett and the AutoIt Team ( http://www.autoitscript.com/autoit3/docs/license.htm )

; --- ------------------------

; - Copyright © by:

; - The AutoItObject-Team:

; - Andreas Karlsson (monoceres)

; - Dragana R. (trancexx)

; - Dave Bakker (Kip)

; - Andreas Bosch (progandy, Prog@ndy)

; ------------------------ END AutoItObject ------------------------

; ------------------------ AutoIt User Defined Functions

; --- by AdmiralAlkex

; --- SDL (Simple DirectMedia Layer) created by Sam Lantinga and the SDL Team

; --- by Melba23

; --- MouseOnEvent by G.Sandler

; --- loaddialog.au3 by Joshua Songer for dialog data from file

; --- Windows Operating System

AutoIt code snips from AutoIt Forum or other website

- - - wakillon provided a easy working example of how to capture mouse wheel events in AutoIt

I have copied his code and adapted it for my purposes

Anyone who has ever assisted anyone with programming has contributed to this project.

I couldn't do this without all of you.

Thank you.

Edited by Xandy
Link to comment
Share on other sites

Added a music player, picks 50 random songs from a dir of your choice or however many music files are in the folder.

The best change is the sourceclass now inherits the windowclass, instead of passing matching indexes around.

The "Surfer test portable" link is just for me to make sure the source compiles on my other computer. Use the main link with the download counter.

Source on my site. ( LINK )

Edited by Xandy
Link to comment
Share on other sites

Interesting app, but I'm not sure how to do that drawing like you do. Maybe make a tutorial/readme for the next version? ;)

Also music system is buggy/unfinished(?). First Surfer was just crashing at start because he couldn't found any music in the default folder, then nothing plays when the app start and M+F9 only play 1 song before it stops.

Edit: Though to be honest it doesn't strike me as a necessary feature. I usually already have a music player running in the background.

Also it would be nice to be able to resize the window directly by it's borders like a normal window.

Also once when I ran it with debug on I got this crash, I don't know what I did to cause it.

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:UsersAdmiralDesktopsurfersurfersurfer.au3" /UserParams
+>11:02:21 Starting AutoIt3Wrapper v.2.1.0.34   Environment(Language:0409 Keyboard:0000041D OS:WIN_7/Service Pack 1 CPU:X64 OS:X64)
>Running AU3Check (1.54.22.0) from:C:Program Files (x86)AutoIt3
+>11:02:21 AU3Check ended.rc:0
>Running:(3.3.8.1):C:Program Files (x86)AutoIt3autoit3.exe "C:UsersAdmiralDesktopsurfersurfersurfer.au3"
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
Loaded SDL_image version: 1.2.7.*
Loaded SDL version: 1.2.13.*
C:UsersAdmiralDesktopsurfersurfer..systemFontsqbasic_font1.txt
amax 5
a Toggle Colorkey
a Scale
a Alpha
a Flip
a Rotate
a Resize
files 5
0 5
1 Lester's Possum Park.mp3
2 On the Open Road.mp3
3 I2I.mp3
4 After Today.mp3
108
font 90C:UsersAdmiralDesktopsurfersurferincludewindow.h.au3 (222) : ==> Array variable subscript badly formatted.:
$tempsource= $source[$newsourcecur]
$tempsource= $source[^ ERROR
->11:03:42 AutoIT3.exe ended.rc:1
>Exit code: 1   Time: 81.921
Edited by AdmiralAlkex
Link to comment
Share on other sites

Yes the music system didn't receive allot of focus. I wrote it so I could have random music for videos I create. I used music from a online puzzle game I was playing in the first video and decided that I need music I am sure had no copy-write.

I found about a gigabyte of free gaming music at http://www.nosoapradio.us/. It is meant to be an example of a music player, I can't have it crashing, thank you for the heads up.

I was able to recreate the crash you reported, it happens when mouse-wheel scrolled with no sources loaded.

I'll fix these issues and make a documentation.

Thank you for the feed back.

Both errors are now fixed.

Edited by Xandy
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...