neutrinox's Recent Forum Activity

  • Thanks codah, I didn't realize that because I apparently only checked the example from the thread you linked. I'll try your system now!

  • Hi!

    You are right, I expressed myself incorrectly when I was talking about storing values in the x-axis. I should have said "y0" instead.

    I think I will still experiment in doing a quick y-order swap before doing the sorting, just because my project has been built to depend on the names being on y0 and I would need to find and replace many parts of my project.

    I guess I can just build something like this (pseudo code), perhaps inside a fuction:

    on Function "ySwap"

    For each item at y0, store them in a temporary array at y0. For each item at y1 store them in a temporary array at y1. For each item at temporary array y0, store them at real array y1. For each item at temporary array y1 store them at real array y0. Then do the sorting and put the names in place. Finally run the function again.

    I think I will give that a try because my project is so complicated and I'm scare of messing it up if I start changing the older logic in which names are at y0.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hmmm... maybe there is a way, even if the values to be sorted are not on the y0-axis.. What if you temporarily switch y-rows so that the row you need to sort is y0... I'm sot sure if such a switch is possible, but I think that would solve the problem!

  • Thanks for your replies!

    Do you understand what actually happens when I sort the array Y-axis? Oh maybe I actually get it now, is it like this:

    Before sorting Y:

    y0 values: a, b, c, d, e, f

    y1 values: 1, 2, 3, 4, 5

    y2 values: 6, 7, 8, 9, 10

    After Sorting Y:

    y0 values: 1, 2, 3, 4, 5

    y1 values: 6, 7, 8, 9, 10

    y2 values: a, b, c, d, e, f

    In other words, is the sorting vertical? Is there no way to sort the Y-axis horizontally?

  • Hi!

    I'm trying to make a "top three" list for my game.

    During the game, I store points in a 2d-array. The X-dimension has the player name stored. The Y-dimension stores the points.

    When the player goes to the highScore layout, I'm want to display a top three list in which the player with the highest score is first, then comes the player with the second highest score and so on.

    My tactic (which doesn't seem to work) was to sort the array based on it's Y axis and then reverse it so that the order is descending. I'm not sure if I understand correclty how sorting works though. If I have an array like this:

    [john,2][mike,5][tom,1]

    and I sort it and then reverse it on the Y-axis, shouldn't the result be:

    [mike,5][john,2][tom,1]

    Or is that not how sorting works?

    My next step after sorting and reversing is to do a for-each loop for the array in which I fill the top three text slots in the order of the array. But this concept doesn't seem to work because all the names will be in their original order, not in the order I thought I achieved by sorting them.

  • Do I dare to bump this? If the answer is "you have to ransack each layout manually" then I appreciate hearing that too!

  • Hi!

    I have several layouts and I know I have a certain object somewhere in one of them. I can find the object in the project panel. But is there a good way to find out which layouts contain that object without manually opening and checking each layout?

  • Wow, brunopalermo, that's a very elegant solution! So much simpler than the crazy clusterf*ck I had going on

    Thank you very much for such a beautiful solution!

  • brunopalermo I appreaciate your voice of sanity. However, the very first thing I tried was using a single text box for everything, but for reasons I don't remember very well anymore, it couldn't achieve what I needed with just that. One thing that I know for sure was that I couldn't color the individual sentences inside the text box (at least without external plugins). It would be nice if one could use something like html-tags inside the text area to mark different texts for different treatment, but I don't think that's possible. Do you know of a way to color the individual sentences inside a single text area?

    But maybe you're right and I should "kill my darlings" (meaning coloring the sentences based on the character speaking), I think I will do some more testing with that approach too. It's just that my admittedly more complicated setup is finally working pretty well, the only detail is the "scroll handle" size, which I'm fairly confident can be solved. I'm also a bit worried about having something like 1000 sentences of text in a layout. Currently there is only about 6 text objects (sentences) at any one moment. It would indeed be interesting to know which way is better for performance (or if there is any effect what so ever). So far I have been getting pretty solid 60fps in that layout on my desktop computer.

    LittleStain

    It's the adding actions part that is the question mark. I can indeed detect when something should be done (based on the y-position), but I'm not sure what the right action would be. I now have the image point at the top of the scroller, so scaling the object won't help with the upper part of the screen.

    Maybe it might be possible to dynamically create another scroll handle object when needed and pin the old one to it. This way it might be possible to keep scrolling with the newly created scroll handle and the old one would follow it. I might give that a try.

    EDIT:

    I think there would be a very easy solution to this, if the image point used for scaling could be changed dynamically. But that's not possible I assume?

  • Dang it, it wasn't so simple after all. On the other hand I'm relieved, because I thought I was just an idiot for not finding this easy solution.

    The problem with your solution LittleStain is that when the user scrolls the rectangle downwards, the top part of the screen is no longer covered by it..

    So I'm still searching for a solution after all...

  • brunopalermo

    There are many reasons, like for example I'm destroying the text objects when they get out of the view (and re-creating them when they are entering back) to not have a huge amount of text sitting around doing nothing. I also need to colorize the different sentences with different colors depending on who is speaking.

    LittleStain

    Could it be that simple! I will try that immediately!

    Edit:

    LittleStain it seems to work nicely! I'm embarrassed how simple the solution was. Too much staring at the screen and too little sleep.

  • Hi!

    I'm developing a plugin-free dialogue system, in which the user can scroll the dialogue history as he wishes.

    The way I have been implementing it is that I have a big rectangular sprite, that has the drag and drop behavior (for the scrolling). When a new sentence is added on the screen, it is instantly pinned to the rectangle.

    It's working quite nicely already, but I'm not sure about something that might be a simple problem:

    I want my rectangular area to always fill the whole screen, so that the user can grab it no matter how much it has been scrolled. I can't simply change it's position, because the sentences are pinned to it. My first idea was to change the size of it, but it seems like I can only grow the size in one direction and then it doesn't cover the other side of the screen.

    This would be super easy to do if there was a way to set the coordinates of the four corners of this area, but I'm not sure if there any such possibility in construct?

    Edit: Another approach that I was thinking about (I have no idea about if this is feasible) would be to dynamically add "slices" to the top and bottom edges of the rectangle to grow it. Would something like this be possible with containers? In other words, could I make one big container that everything gets pinned to and then keep adding parts to this container to always have it fill the screen?

    Edit2: I studied containers a bit more, and that approach will probably not work.

    To summarize: is there a clever way to keep dragging a rectangle while always having it cover the whole screen?

neutrinox's avatar

neutrinox

Member since 17 Jan, 2014

None one is following neutrinox yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies