Javascript help | Technology | TORN
Javascript help
  • Atls Syncopate [2562293]Syncopate [2562293]
    • Syncopate [2562293]
    • Role: Civilian
    • Level: 50
    • Posts: 277
    • Karma: 121
    • Last Action: 4 minutes
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Thread created on 04:48:43 - 22/04/21 (6 months ago)
    |
    Last replied 22:12:19 - 28/04/21 (5 months ago)
    If I were to make a pure JS card game, which of these methods would be best to display the cards: html canvas or just css? Not feally interested in some other framework.
  •   Sheev [1522784]Sheev [1522784]
    • Sheev [1522784]
    • Role: Civilian
    • Level: 31
    • Posts: 44
    • Karma: 19
    • Last Action: 2 hours
    • Quote
    • Report
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 22:12:19 - 28/04/21 (5 months ago)
    Post link copied to clipboard Copy post link
    What kind of cards are you going to display? If you're planning on using standard playing cards they're actual unicode characters that you can just render in the browser and resize accordingly. Here's some information about unicode playing cards.

    Strictly speaking I'd recommend using CSS both in the case of the unicode characters or your own custom cards just for the sake of flexibility. If you're using CSS you can make the app a bit more responsive with some breakpoints, whereas my (limited) experience so far with canvas has always been that more precise image sizing takes a bit more calculation and can still be sort of rough around the edges.

    Out of curiosity, why do you not want to use any other frameworks for this?
Reply
Thread Title: