Bookstore

 Computer Math and Games in Pascal (preview) Lazarus Handbook

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

Roland57

• Jr. Member
• Posts: 51
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;

• Hero Member
• Posts: 1200
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.02 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

• Hero Member
• Posts: 1200
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...

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.02 •  VSSTUDIO(.Net) 2019 • Win10 • 16G RAM • Nivida GForce RTX 2060

Roland57

• Jr. Member
• Posts: 51
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.

circular

• Hero Member
• Posts: 3308
Re: [SOLVED-WORKAROUND] SpriteAnimation Ctrl - Animate sheet w/multiple Rows
« Reply #19 on: April 03, 2020, 11:35:08 pm »
Perfect now
Conscience is the debugger of the mind