Rotatable Doodads #82

開放中
建立於 2022-05-08 17:42:59 +00:00kirsle · 0 comment
擁有者

Some ideas how doodads can opt-in to be rotate-able, examples:

  • Buttons are all drawn to be placed on floors, but could rotate them in 90 degree increments to put on ceilings/walls without needing duplicate sprites for each direction.
  • New directional doodads like Springs could benefit from being rotatable.
  • The 4x trapdoors could be trimmed down to 1x that can rotate.

How doodads opt in?

  • A doodad json property like Rotatable int (default 0 = can't rotate, otherwise specify the degrees of rotation supported, 45, 90, etc.
  • Update: commit 701073ce adds Doodad Options support, a doodad can define a "rotation" option (name arbitrary), handle the integer how it wants, and (in JavaScript) call a function like Self.SetRotation()

How to rotate a doodad in your level?

  • Actor Tool, mouse over a doodad: instead of whole doodad getting an orange outline (to click & drag it), add small buttons to click on that rotates it?
  • A dedicated Rotator tool? when selected, doodads that can't rotate mute out in color, click a doodad to rotate it.
  • Update: with the Doodad Options support, you just click on the Actor Properties button (on mouseover of the doodad) and go to the Options tab.

How it looks to the doodad scripts?

  • Can rotation be done transparently? e.g., actor collide events automatically adapt coordinates to undo the rotation so the actor script is written to assume a default rightside up orientation
  • Otherwise the actor script can query its rotation value and handle the logic itself

https://wiki.libsdl.org/SDL_RenderCopyEx

Some ideas how doodads can opt-in to be rotate-able, examples: * Buttons are all drawn to be placed on floors, but could rotate them in 90 degree increments to put on ceilings/walls without needing duplicate sprites for each direction. * New directional doodads like Springs could benefit from being rotatable. * The 4x trapdoors could be trimmed down to 1x that can rotate. How doodads opt in? * A doodad json property like Rotatable int (default 0 = can't rotate, otherwise specify the degrees of rotation supported, 45, 90, etc. * **Update:** commit 701073ce adds Doodad Options support, a doodad can define a "rotation" option (name arbitrary), handle the integer how it wants, and (in JavaScript) call a function like Self.SetRotation() How to rotate a doodad in your level? * Actor Tool, mouse over a doodad: instead of whole doodad getting an orange outline (to click & drag it), add small buttons to click on that rotates it? * A dedicated Rotator tool? when selected, doodads that can't rotate mute out in color, click a doodad to rotate it. * **Update:** with the Doodad Options support, you just click on the Actor Properties button (on mouseover of the doodad) and go to the Options tab. How it looks to the doodad scripts? * Can rotation be done transparently? e.g., actor collide events automatically adapt coordinates to undo the rotation so the actor script is written to assume a default rightside up orientation * Otherwise the actor script can query its rotation value and handle the logic itself https://wiki.libsdl.org/SDL_RenderCopyEx
kirsle 加入了
enhancement
標籤 2022-05-08 17:42:59 +00:00
登入 才能加入這對話。
未選擇里程碑
沒有負責人
1 參與者
通知
截止日期
截止日期無效或超出範圍,請使用「yyyy-mm-dd」的格式。

未設定截止日期。

先決條件

未設定先決條件。

參考: SketchyMaze/doodle#82
No description provided.