Page 1 of 1

[WIP] sweet animation = add sugar to animation library

Posted: 13 Feb 2018, 20:32
by wolf_II
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!

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

    Posted: 13 Feb 2018, 20:33
    by wolf_II
    First look
    Animation.zip
    (4.25 KiB) Downloaded 111 times

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

    Posted: 13 Feb 2018, 21:59
    by wolf_II
    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 89 times

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

    Posted: 13 Feb 2018, 22:19
    by guest3456
    link to a screenshot/gif/video?

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

    Posted: 13 Feb 2018, 23:54
    by wolf_II
    @guest3456 oops, sorry, I'm going to add some soon.

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

    Posted: 14 Feb 2018, 01:59
    by wolf_II
    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.

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

    Posted: 14 Feb 2018, 03:08
    by BoBo
    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:

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

    Posted: 14 Feb 2018, 03:25
    by wolf_II
    ROFL

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

    Posted: 21 Feb 2018, 00:42
    by wolf_II
    Here is a better demo: things are moving now!
    Pong.zip
    (7.68 KiB) Downloaded 88 times