Recent

Author Topic: [SOLVED-WORKAROUND] SpriteAnimation Ctrl - Animate sheet w/multiple Rows  (Read 4903 times)

Roland57

  • Sr. Member
  • ****
  • Posts: 416
    • msegui.net
Re: SpriteAnimation Ctrl - Animate sheet w/multiple Rows
« Reply #15 on: April 03, 2020, 07:22:31 pm »
Here is the correction:

Code: Pascal  [Select][+][-]
  1.     //y := (i div ARowCount) * LElementHeight;
  2.     y := (i div AColCount) * LElementHeight;
My projects are on Gitlab and on Codeberg.

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: SpriteAnimation Ctrl - Animate sheet w/multiple Rows
« Reply #16 on: April 03, 2020, 07:32:46 pm »
I have it narrowed down to this line...
Everything else is outputting correctly.

BGRAReplace(LElement, LOldFile.GetPart(Rect(x, y, x + LElementWidth, y + LElementHeight)));

For my 123456789101112 sample.
x.y outputs 0,200,400,600

So those go through the grid correctly

UPDATE: This line wasn't the problem.
See the solution below
« Last Edit: April 03, 2020, 08:04:23 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: SpriteAnimation Ctrl - Animate sheet w/multiple Rows
« Reply #17 on: April 03, 2020, 07:37:42 pm »
Here is the correction:

Code: Pascal  [Select][+][-]
  1.     //y := (i div ARowCount) * LElementHeight;
  2.     y := (i div AColCount) * LElementHeight;

I guess I got that wrong...

Your code worked.
y := (i div AColCount) * LElementHeight;

Thanks for helping me on this Roland!!!
Great Job
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

Roland57

  • Sr. Member
  • ****
  • Posts: 416
    • msegui.net
Re: SpriteAnimation Ctrl - Animate sheet w/multiple Rows
« Reply #18 on: April 03, 2020, 08:21:27 pm »
Thanks for helping me on this Roland!!!
Great Job

You're welcome. I have cleaned my project. Here it is.
My projects are on Gitlab and on Codeberg.

circular

  • Hero Member
  • *****
  • Posts: 4181
    • Personal webpage
Perfect now 8-)
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018