0 Favourites

SPAWNED SPRITES ARE DRAWN INCORRECTLY

  • i have a quick question:

    i have a sprite (a cloud) that is perfectly smooth on the edges (both in the drawing program, and when imported as a sprite into C2 as PNG-8). when the original sprite is placed on the screen, it's still smooth (no problem so far), but when i spawn copies of the cloud sprite...the copies are all jagged edged and blurry. i'm using version r150 dont know if that helps).

    can you please help and let me know why the original is smooth in and out of C2; but the spawned copies look like crap?

    thanks a million, in advance.

  • Could you be spawning more then one sprite at a time?

  • yes, i spawned several copies of the cloud at different x/y locations. all spawned copies have jagged edges (they are all the same size as the original; just drawn like crap)..yet the original sprite on the screen looks great.

    help please

  • Do you have a capx to look at?

  • Burvey...thanks for all your help, but after 2 days of working on this i stumbled by accident on the solution..i still dont know why it works, but it does (if you can explain it to me, please do).

    if i call either "Create object" or "spawn object" from an event that compares vales (x=y...current level=5...etc) then the spawned sprites have jagged edges...but if i call the same "Create object" or "spawn object" from a time-related event (eg "compare time") then the spawned sprites are as smooth as the original...flawless. why the time-event makes a difference i dont know. is there a better solution, i dont know. i would love to post the capx, but dont know how to do that either. hope this helps, and saves someone else days of wasted development time and frustration. now back to the cool stuff i hope i can do with C2.

  • I think Burvey meant you may be spawning them constantly on the same location so they would appear blurry as its loads of clouds overlapping? Maybe the time event works as expected and only spawns the one cloud but the variable comparison is always true so it keeps spawning them. Cannot tell without looking at the events really : D

  • damn dude....that's it !!!!

    after reading your post plinkie, i went back and changed the time interval to make it happen super quickly (to replicate the "variable comparison is always true so it keeps spawning them" theory) and it produced the same jagged result. you're 100% right. so let me ask you this: if i want to test something (variable comparison) and spawn (but not continously, as you've pointed out)...whats the best way to do that? how can i toggle that functionality on/off to prevent endless spawing?

  • You can use global variables to set true/false when something has been spawned. Just make sure the condition for spawning is limited. If you need something specific I need to know what event you currently have for spawning an object i.e. what has to be true for the object to be created?

  • i tried your approach with a varialbe i called "new level". so if "new level" = true; then spawn clouds, etc. if variable<>true, the function does not get called. last question, i promise: i dont want to creat too much system demand. so i check for the variable with "system - every 0.5 seconds". is that ok, or is that totally retarded and there's a better/optimal way of doing this?

  • Are you just trying to spawn clouds at the start of the level? If so, then you can just use OnStartOfLayout action and there's no need for variables.

    For system demand it's fine because all events are run every tick anyway. You can use EveryTick or Every X seconds, I think either is fine although EveryTick could be better suited for some reason.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • yes, all i want to do is spawn clouds etc at the start of the level. thanks a million; moving function calls into start of layout works. i have to rework the logic and the flow of the layout...but that's not major surgery, and is doable and its alot better than checking a toggle variable 60-times a second. thanks a million you guys are the best. :-)

  • no problem, good luck!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)