Populating a chat that includes picture Icon?

0 favourites
  • 4 posts
From the Asset Store
Chat with smart animals using the OpenAi Chat GPT 3 API
  • Not sure if this is a general or a how do I question, more of a best practices type of question.

    I have a chat bar that has a icon (sprite) of the person posting the message before the text.

    If one uses a function to space the chat:

    call function, create sprite x,y, create text x,y and then loop

    create sprite2 & text.height + a spacer (setting the spacing for new sprites and new texts)

    the new sprites are created at the original x,y (due to the function happening in one tick and no time for the new x,y or height settings to apply. A loopindex, etc will not work either...same issue as above.)

    My question is this, other than doing a function & local variable, thus calling function 2, 3, 4 etc. or by long coding the chat. Is there any other way to get the proper spacing of newly created items?

    (Hopefully this question isn't too confusing. I've asked this question before and never gotten a definitive answer.) Regards

  • Can you post your c3p? I'm not quite following what you are asking

  • Again, I'm not sure exactly what you are doing but you could use an invisible sprite (chatpos) that acts as the locator for the new chat line and have it move to the new position at the end of the function.

    You can pass parameters to the function to determine who's avatar and message will be shown

    on message pending - call function 'chat' w parameters (username,chattext)

    Function 'chat'

    create object by name "avatar"&username at chatpos.imagepointX("username"), chatpos.imagepointY("username")

    create object 'text' at chatpos.imagepointX("text"), chatpos.imagepointY("text")

    text - Set text to "chattext"

    chatpos - move at 90° text.heightpx+10px

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Let me withdraw the question for now. I need to make a capx with a couple examples and share it.

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