Coder Social home page Coder Social logo

Comments (8)

ryanbourneuk avatar ryanbourneuk commented on August 27, 2024

I've already had a look at https://github.com/YannickL/CCControlExtension/issues/17… I do not use '-hd' suffixes in the sprite name and it can't be due to rotated sprite frames as the button shown above is not rotated in the sprite sheet.

from cccontrolextension.

yannickl avatar yannickl commented on August 27, 2024

Hi Ryan,

Is the texture you shown is present in your sprite sheet or not at all?

I'm sorry I'll not be available before the beginning of the next week to check the code. :(

from cccontrolextension.

ryanbourneuk avatar ryanbourneuk commented on August 27, 2024

Thanks for getting back quickly, it's really appreciated :)

I've made it work by adding a -hd suffix to the sprite sheet and the sprites inside it… maybe something was making it look for a non-hd version? It was included in the sprite sheet :)

However I have other issues, one where the label is displayed to the right of a sprite, and another where the sprite is not scaled correctly to fit a label.

No worries :)

Thanks.

from cccontrolextension.

ryanbourneuk avatar ryanbourneuk commented on August 27, 2024

Just to expand on my earlier points:

It appears the label was placed towards the right of the sprite (and generally incorrectly in most instances) due to calling 'setEnabled' then calling 'needsLayout' - which I believe was causing a mis-placement of the objects. After removing the 'setEnabled' calls from my game's code it showed the objects correctly. This also fixed an issue where the button's contentSize & boundingBox was abnormally larger than the actual button, which was affecting the touch-detection on the button.

I have still not been able to find a solution or possible cause for when the sprite is not scaled up to fit the text.

I will be more than happy to send some example code over, just possibly not publicly.

Thanks for your time.

from cccontrolextension.

yannickl avatar yannickl commented on August 27, 2024

@CodeMonkeyzDevelopment Sorry for the late.

Yes It would be really helpful (and quicker) if you could send me some example code (contact (at) yannickloriot.com). πŸ‘

I'll check that. Thank you!

from cccontrolextension.

yannickl avatar yannickl commented on August 27, 2024

HI @CodeMonkeyzDevelopment,

Sorry for the late. I just apply some fixes for your issues. I have to clean the code, but it should works now.

For your button just set the adjustBackgroundImage flag to NO because you have no label and so if the flag is activated the background image will try to fit the label which has no size (CGSizeZero). :)

from cccontrolextension.

ryanbourneuk avatar ryanbourneuk commented on August 27, 2024

Awesome, no worries :D
Thanks for the new code :) I didn't realise that boolean existed, I've begun using it and it all works :D Thank you so much! :)

from cccontrolextension.

yannickl avatar yannickl commented on August 27, 2024

Thank you too for your code, it really helps me for debugging. πŸ‘

from cccontrolextension.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.