Jump to content

superolelli

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by superolelli

  1. I noticed a problem regarding sounds: The volume for sounds is not set correctly. It seems to be always set to 1. Do you have any ideas what the problem could be? EDIT: If I understand the code correctly, the value for the volume is loaded in SpriterDocumentLoader::getSoundObjectInfoFromSoundlineKey(...) and stored in a SoundObjectInfo, which is then passed to a TimelineKey. On call of SpriterModel::getNewEntityInstance() a SfmlSoundObjectInfoReference is created, which holds the actual Sound object of SFML. By debugging i found out that the correct volume is loaded and stored into the SoundObjectInfo. Also setting the volume from outside by calling setVolume() on the object returned by EntityInstance::getSoundObject() works as expected. But somehow the volume loaded from the xml, which is stored in this SoundObjectInfo is not passed to the actual sf::Sound that is stored in the SfmlSoundObjectInfoReference. When calling getVolume() on the object returned by EntityInstance::getSoundObject() the returned value always is 1. SECOND EDIT: I managed to fix this by changing the code of the body of the for-loop that iterates over the soundTimelines in Animation::setupAnimationInstance(...) into: auto newVolume = dynamic_cast<SoundObjectInfo*>(it->getLastKey()->getObjectInfo())->getVolume(); SoundTimelineInstance *newInstance = new SoundTimelineInstance(entityInstanceData, it, it->getObjectId()); newInstance->getResultObject()->setVolume(newVolume); timelineInstances->push_back(newInstance); This is probably not the best way to fix this but it works for me right now. If you have a cleaner solution, maybe you could share it
  2. Hi, I think I've got the same problem that Breush had earlier. I tried to retrieve the position of a point but I always get 0. I did it this way: SpriterEngine::UniversalObjectInterface *pt = body->getObjectInstance("arm_point"); pt->getPosition().x; Do you know, what the problem could be? And here's another thing: I made an animation consisting of two subentities. Now I want to render them seperately. I tried it this way, but my program crashed. dwarf->setCurrentAnimation("walk"); dwarf->setTimeElapsed(timeElapsed); SpriterEngine::UniversalObjectInterface *body = dwarf->getObjectInstance("body"); body->render(); delete(body); SpriterEngine::UniversalObjectInterface *arm = dwarf->getObjectInstance("arm"); arm->render(); delete(arm); "dwarf" is the entityInstance. Any idea, how i can get this working? Greetings superolelli
  3. Hi, is it possible to play two animations at the same time? Imagine a character, which can e.g. walk and shoot. Now I want, that this character can walk and shoot at the same time. If the walking animation doesn't effect bones used by the shooting animation that should be possible, shouldn't it? Is there a way to achieve this?
  4. Hi, i downloaded the sourcecode from github and I wanted to try the example, but got a compilation error. The problem is, that the method newImageFile in examplefilefactory.h does not override the method in filefactory.h properly. Obviously the code of the "core-engine" has been changed, but the example hasn't been updated. I tried to fix it myself, but it didn't work out, because I've never used this code before. I just wanted to get used to it and how it is working. Can someone fix the example? Would be very nice Greetings superolelli
×
×
  • Create New...