Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

insert skeleton.group into composer sceneGroup problems
Started by burnsj002 Oct 01 2015 12:31 PM

6 replies to this topic
spine skeleton.group scenegroup
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

burnsj002

[GLOBAL: userInfoPane.html]
burnsj002
  • Contributor

  • 212 posts
  • Corona SDK

I'm using the code for the Corona runtime library

 

Whenever I insert the skeleton.group to the composer sceneGroup  -- the spine images just disappear.

sceneGroup:insert( MenuScene.skeleton.group )​

I have to create a new display group in order to cleanup the images on exiting the scene but I can never add the display group to the composer sceneGroup ! This is irritating when you want to do layer ordering for the entire scene.

 

What gives?

Anybody can help me with this?



[TOPIC: post.html]
#2

kilopop

[GLOBAL: userInfoPane.html]
kilopop
  • Contributor

  • 258 posts
  • Corona SDK

I haven't tried to put skeleton.group straight into sceneGroup but I'm always putting them into another group which is itself a child of the sceneGroup so it should be possible.



[TOPIC: post.html]
#3

burnsj002

[GLOBAL: userInfoPane.html]
burnsj002
  • Contributor

  • 212 posts
  • Corona SDK

Hey kilopop,

 

Thanks! I got it to work.

 

Do you use "spineHelper"? Is that make things easier?



[TOPIC: post.html]
#4

kilopop

[GLOBAL: userInfoPane.html]
kilopop
  • Contributor

  • 258 posts
  • Corona SDK

Good stuff. Yeah, a dedicated library such as spineHelper is a good idea. I've developed one for my own use. Thare are a few other wrappers out there including my own you can check out at this thread:

https://forums.coronalabs.com/topic/58065-coronalua-runtime-great-optimization-potential/



[TOPIC: post.html]
#5

burnsj002

[GLOBAL: userInfoPane.html]
burnsj002
  • Contributor

  • 212 posts
  • Corona SDK

I can't get spineHelper to work -- it's no better then when I changed the code myself to load a spritesheet, actually mine was a little better. But all the scaling is wrong when I use spineHelper. Each of the textures are scaled all different crazy scales ugh.

 

Does spineHelper only work(Or using a spritesheet) if the images are not scaled at all in the spine editor program?



[TOPIC: post.html]
#6

burnsj002

[GLOBAL: userInfoPane.html]
burnsj002
  • Contributor

  • 212 posts
  • Corona SDK

It works, it's just some of the images a scaled wrong. If I load the images one at a time with no spriteSheet it works perfectly --

What the heck am I doing wrong?

 MenuScene.spineSheetInfo = require( "cindersstep" )
   MenuScene.spineSpriteSheet = graphics.newImageSheet( "cindersstep.png", MenuScene.spineSheetInfo:getSheet() )
   
    MenuScene.skeletonData = json:readSkeletonDataFile("cindersstep.json")
   
    MenuScene.skeleton = spine.Skeleton.new( MenuScene.skeletonData)
    function MenuScene.skeleton:createImage (attachment )
            -- Customize where images are loaded.
            local attachment_name = attachment.name:sub( 8 )
            return display.newImageRect( MenuScene.spineSpriteSheet, MenuScene.spineSheetInfo.frameIndex[ attachment_name ], attachment.width, attachment.height )
            --return display.newImage("cinders_step_spine/" .. attachment.name .. ".png")
    end​


[TOPIC: post.html]
#7

burnsj002

[GLOBAL: userInfoPane.html]
burnsj002
  • Contributor

  • 212 posts
  • Corona SDK

I figured it out. I have too much padding in my images. I have to crop them to fit exactly around each image. You have to do that to use texture packer.




[topic_controls]
[/topic_controls]