[WIP] sweet animation = add sugar to animation library

Post your working scripts, libraries and tools for AHK v1.1 and older
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

[WIP] sweet animation = add sugar to animation library

13 Feb 2018, 20:32

sweet animation = add sugar to an animation library
write your own sugar.ahk or check the examples

Intended goals:
  • write a easy to use, generally useful class, maybe merge GLOBALS.ahk to a single file, technically not making a pure class, hmm .. :think:
  • grow Sugar.ahk to contain as much syntax sugar as one pleases, this is the FUN part :D
  • grow Maths.ahk as required by the currently present example scrpts
  • grow Physics.ahk as required by the currently present example scrpts
Credits:
  • Chris Mallett for AutoHotkey v1.0
  • Steve Gray for AutoHotkey v1.1 (Lexikos)
  • Tic for his awesome Gdip library
  • tmplinshi for his awesome AutoXYWH() function ; not yet used but planned
  • AHK-forum I have collected code snippets for about 10 years
  • Whenever I forget to mention anybody in particular, please post about it
  • my own effort is to glue everything together, and present code that I can still read and understand in 6 moths time
Requirement:
  • min Windows version 8.x
  • UpdateLayeredWindow requires WS_EX_LAYERED to work with controls rather than just with top-level Windows. (thx just me for the hint)
Structure:
  • a folder Animation with example scripts containing ...
    • Lib folder with
      • class Animation.ahk ; work in progress
      • GLOBALS.ahk ; is currently a separate file
      • Sugar.ahk ; make it as sweet as you like
    • Include folder with
      • Maths.ahk
      • Physics.ahk

    See next post for a first look!
    wolf_II
    Posts: 2688
    Joined: 08 Feb 2015, 20:55

    Re: [WIP] sweet animation = add sugar to animation library

    13 Feb 2018, 20:33

    First look
    Animation.zip
    (4.25 KiB) Downloaded 105 times
    wolf_II
    Posts: 2688
    Joined: 08 Feb 2015, 20:55

    Re: [WIP] sweet animation = add sugar to animation library

    13 Feb 2018, 21:59

    Next:
    • added Pong example
      (seems to not redraw consistently)
      (not the full game, rather a first try to implement mouse interaction)
    • added Include\GUI.ahk
    Animation.zip
    (6.25 KiB) Downloaded 81 times
    guest3456
    Posts: 3462
    Joined: 09 Oct 2013, 10:31

    Re: [WIP] sweet animation = add sugar to animation library

    13 Feb 2018, 22:19

    link to a screenshot/gif/video?

    wolf_II
    Posts: 2688
    Joined: 08 Feb 2015, 20:55

    Re: [WIP] sweet animation = add sugar to animation library

    13 Feb 2018, 23:54

    @guest3456 oops, sorry, I'm going to add some soon.
    wolf_II
    Posts: 2688
    Joined: 08 Feb 2015, 20:55

    Re: [WIP] sweet animation = add sugar to animation library

    14 Feb 2018, 01:59

    Not much to see: I have just drawn straight lines on a canvas.
    Not sure what happened here, I can only see the first screenshot and two downloads.

    Anyway when I was looking for a symmetric flag to draw, wikipedia was showing the pre-1801 Union Flag of Great Britain, unlike the modern, it is very symmetric.
    And I need to delete on Exit all my brushes and pens.
    Last edited by wolf_II on 14 Feb 2018, 18:59, edited 1 time in total.
    BoBo
    Posts: 6564
    Joined: 13 May 2014, 17:15

    Re: [WIP] sweet animation = add sugar to animation library

    14 Feb 2018, 03:08

    Well, we'll discuss to release a special AHK version for the UK in 2019. It'll provide the alternative brExit-command + the interpreter will throw an error once a string contains the character combination 'eu' ! Stay tuned :mrgreen:
    wolf_II
    Posts: 2688
    Joined: 08 Feb 2015, 20:55

    Re: [WIP] sweet animation = add sugar to animation library

    21 Feb 2018, 00:42

    Here is a better demo: things are moving now!
    Pong.zip
    (7.68 KiB) Downloaded 84 times

    Return to “Scripts and Functions (v1)”

    Who is online

    Users browsing this forum: No registered users and 75 guests