[REL] Sketch tools for casters

Discussion in 'Mod Discussions' started by Martenus, March 18, 2014.

  1. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    An arrow might be doable by listening for mouse release and then drawing a rotated image of an arrowhead at the end of the line.[/quote]

    The canvas API is actually vector based, although you'd need to clear and redraw to have a live preview. SVG might be more appropriate for live updating objects.
  2. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    He didn't mean a live preview, just an arrow that is drawn with its orientation matching the last known direction of the mouse.
  3. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    What I meant by Live Preview is that while the mouse is going from start point to end point, you the arrow is being draw as if the mouse button was released at that point.
    Martenus likes this.
  4. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    I think I can actually automatically create a color palette using the army colors of players in the game. I really like that @LavaSnake is working on the tools so that I can focus on the UI. I'll make a github project later so that we can switch those roles around a bit if you have some ideas for the front end.
    LavaSnake likes this.
  5. Martenus

    Martenus Well-Known Member

    Messages:
    530
    Likes Received:
    437
    Those would definatelly be enough, actually more than that. If you look at the TV analyses they do using drawing, they don't use more than 2 colors anyway.
  6. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    I will probably have a third color as well, in case you wanted something neutral. I would just leave that yellow every time, but some players might be yellow. It could take some work to automatically create a good neutral color every time.
  7. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    It looks like the drawing tool we are using already just draws a vector on a time interval as long as the mouse button is down. The arrow can just point in the direction of the last vector drawn.
  8. Martenus

    Martenus Well-Known Member

    Messages:
    530
    Likes Received:
    437
    What about all the time same colors:
    Red, Navy and Black? All of these exist as army colors.
  9. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    I'm not sure what you mean. The problem would be to come up with a color that is as far away as possible from any of the team colors currently being used, while still being bright and easy to see on a stream.
  10. Martenus

    Martenus Well-Known Member

    Messages:
    530
    Likes Received:
    437
    Casters will not use the color of the team to draw the arrows, you only need two colors to distinqueish the "moves" you are drawing, it is obvious what color match a player based on its direction.
  11. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    So you want different types of colors for different types of lines, rather than team colors?
  12. trialq

    trialq Post Master General

    Messages:
    1,295
    Likes Received:
    917
    I'd use red yellow green colours, with a black outline. This way the colours could convey information if the caster desired (traffic light style; danger zones, safe zones, preferred routes etc).
  13. Martenus

    Martenus Well-Known Member

    Messages:
    530
    Likes Received:
    437
    Well,
    I think it would be simplier like that, to only have three shapes:
    • vector arrow
    • vector circle
    • free-drawing
    And these shapes can be in three colors:
    • red
    • blue
    • black
    There would be a simple interface, three buttons to click a shape and three buttons to select color. And a button to clear the screen.

    It needs to be working quick, imagine an army is moving to one's base, you want to draw a "this army will move this direction and see this defending army over there, if they move this way (draws an arrow) they will be able to stop the attacking force".

    So the interface needs to be just "click arrow - click red - do a quick shape - click another color - draw the same shape and done. Couple seconds timeframe for the arrows to be useful only.
  14. Clopse

    Clopse Post Master General

    Messages:
    2,535
    Likes Received:
    2,865
    Blue will suck on water maps and red not so clear on lava maps I reckon.
  15. Martenus

    Martenus Well-Known Member

    Messages:
    530
    Likes Received:
    437
    If it is the same color as armies it will be ok. amd ofc it is thixk enough, totally fine. i think we can test this later anyway if it doesnt work
  16. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Right now my toolbox looks like this.
    toolbox.jpg
    Martenus and LavaSnake like this.
  17. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    I have it up on GitHub now at https://github.com/pamods/mods-conundrum/tree/master/cSketchJS

    It works, but so far it is very limited. You can free draw, change the colors, and clear the canvas. The arrow drawing doesn't work, but should be able to hook into LavaDraw easily enough. I also still need to get some kind of feedback for hovered and active buttons.
  18. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    That UI looks very nice! To add LavaDraw just make sure it gets loaded after Sketch.js and then switch tools like I show in the Testing Ground.html file.
  19. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Thanks! I think the appearance of caster mods is pretty important, so I'm going to start trying to be more mindful of that when I make things that will show up in a cast.

    Hm, I thought I did that. When you get a chance maybe you can try to figure out what I did wrong.
  20. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Well currently the arrow tool is just a copy of the marker. Would that be an issue?

Share This Page