Hello Guest

Author Topic: bug report  (Read 5314 times)

evax

  • Newbie
  • *
  • Posts: 3
    • View Profile
bug report
« on: June 12, 2013, 05:20:58 am »
1. create spritecollection
2. add spritesheet and set texture (ex: desert.png 100 x 100 tile size 50 x 50 )
3. commit

than add sprite desert/0 ~ desert/9

and sprite definitions size is 10

4. add some sprite ( ex: glass.png )
5. commit

and sprite definitions size is 11

6. remove sptrite desert/8, desert/9
7. commit

but not change sprite definitons size
(still 11)

evax

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: bug report
« Reply #1 on: June 12, 2013, 05:22:50 am »
sorry (ex: desert.png 100 x 100 tile size 50 x 50 ) is wrong

(ex: desert.png 100 x 100 tile size 20 x 50 ) is correct

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: bug report
« Reply #2 on: June 12, 2013, 10:15:22 am »
That isn't a bug, actually but I understand how it causes confusion. The sprite definition count, doesn't actually change. It is an array that only resizes itself when allowed. This is so spriteIDs actually stay the same for sprites that already exist.

If you need to count the actual number of valid sprites in a sprite collection and or process them in whatever way, then run through spriteDefinitions, and ignore ones that are !Valid.

Serge

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: bug report
« Reply #3 on: July 18, 2017, 11:38:57 pm »
is there any way to cleanup this data? i really want to get rid of all those unused sprite definitions.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: bug report
« Reply #4 on: July 21, 2017, 09:16:12 pm »
Hi,

There isn't any way to do this (well there is, but its convoluted). Basically, the id is used by sprite instances to tell it what sprite its using. Its legacy stuff, not pretty, but I would just write a few functions to work around it if it is genuinely an issue. What problem are you trying to work around?