https://linen.dev logo
Join Discord
Powered by
# ceramic
  • b

    billowy-waiter-28954

    08/10/2022, 8:00 PM
    Here,
    ItalicText
    is a reusable
    Component
    that you use like this:
    Copy code
    hx
    var text = new Text();
    text.content = "blah";
    ...
    text.component('italicText', new ItalicText());
  • g

    gifted-whale-78169

    08/10/2022, 10:03 PM
    doesnt work still :/
  • g

    gifted-whale-78169

    08/10/2022, 10:03 PM
    Copy code
    hx
        public function resize() {
            this.size(screen.width, screen.height / 4);
            Begin.pos(width * 0.4, height * 0.5);
            Credits.pos(width * 0.6, height * 0.5);
        }
  • g

    gifted-whale-78169

    08/10/2022, 10:29 PM
    @faint-toothbrush-51643 https://github.com/sharpcdf/ceramic-test/blob/master/src/MainMenu.hx#L74 this is the class
  • f

    faint-toothbrush-51643

    08/10/2022, 11:34 PM
    i meant pos this (the menuoptions)
  • g

    gifted-whale-78169

    08/11/2022, 1:03 AM
    ah ok that makes more sense ig
  • g

    gifted-whale-78169

    08/11/2022, 1:03 AM
    although since the height seems to be the same and the width is the size of the screen, it doesnt seem to be the problem
  • g

    gifted-whale-78169

    08/11/2022, 1:04 AM
    still doesnt have the right position
  • f

    faint-toothbrush-51643

    08/11/2022, 3:42 AM
    that's weird
  • f

    faint-toothbrush-51643

    08/11/2022, 3:43 AM
    try making sure that there's absolutely no positioning code in the create() or anywhere other than the resize
  • b

    billowy-waiter-28954

    08/11/2022, 2:10 PM
    You shouldn’t need to use screen.onResize event
  • b

    billowy-waiter-28954

    08/11/2022, 2:11 PM
    Just override your scene s resize() method and update size/pos of your options object from there
  • b

    billowy-waiter-28954

    08/11/2022, 2:11 PM
    But not that scene resize() will be called on… resize. You still need to do the initial layout in create()
  • b

    billowy-waiter-28954

    08/11/2022, 2:13 PM
    Also, your options object should be a child of the scene. I didn’t see add(options) in your scene code (but maybe I didn’t look at the right place)
  • f

    faint-toothbrush-51643

    08/11/2022, 7:55 PM
    i'm trying to something like an event
  • f

    faint-toothbrush-51643

    08/11/2022, 7:56 PM
    that i put on my music handler
  • f

    faint-toothbrush-51643

    08/11/2022, 7:57 PM
    so that it does the callback function at a specific beat in the music
  • f

    faint-toothbrush-51643

    08/11/2022, 7:57 PM
    and it works
  • f

    faint-toothbrush-51643

    08/11/2022, 7:57 PM
    but it doesn't have a Listener, so it's causing problems when I switch scenes
  • f

    faint-toothbrush-51643

    08/11/2022, 7:58 PM
    as far as I can see, it doesn't seem like ceramic has the ability to do events with additional parameters like the beat, does it?
  • f

    faint-toothbrush-51643

    08/11/2022, 7:58 PM
    just want to know before i go through the trouble of doing it myself
  • b

    billowy-waiter-28954

    08/11/2022, 10:06 PM
    @faint-toothbrush-51643 yes, if you need to add an event for a specific beat, you'll have to add some more code. I did something similar in ceramic.Spine: https://github.com/ceramic-engine/ceramic/blob/master/plugins/spine/runtime/src/ceramic/Spine.hx#L1742-L1766
  • b

    billowy-waiter-28954

    08/11/2022, 10:07 PM
    I expose like:
    onMyEvent(owner, someCustomParam, eventHandler)
  • b

    billowy-waiter-28954

    08/11/2022, 10:08 PM
    Then internally it manages a mapping to dispatch events associated with the correct custom param (in your case the beat)
  • b

    billowy-waiter-28954

    08/11/2022, 10:09 PM
    Anyway, yes, you'll have to build that kind of thing yourself
  • g

    gifted-whale-78169

    08/11/2022, 10:24 PM
    What do you mean by initial layout?
  • g

    gifted-whale-78169

    08/11/2022, 10:25 PM
    Also I add the options to the scene as a child in the constructor
  • g

    gifted-whale-78169

    08/11/2022, 10:25 PM
    I think I changed it though
  • f

    faint-toothbrush-51643

    08/11/2022, 10:38 PM
    pretty sure you should be doing that in create() instead
  • g

    gifted-whale-78169

    08/11/2022, 10:51 PM
    I know, I'm pretty sure I changed it
1...678...124Latest