How do I print multiple pages(exporting to printer)?

  • I'm making a card game for fun (physical) and I'm (planning to) using C3 to help me generating the cards I'm creating. The idea is to have the card data stored in something like an array and then create a layout with multiple cards using the data I gathered so I can print and cut it, like this.

    Currently I have a placeholder page that looks like thisand I'm using the "take snapthot" action and saving the snap shot of the layout as a image so I can print it outside C3. The problem is that I have lots of sheets with diferents cards to print and it will be a pain to have to save each diferent page individualy as a image to print it outside C3.

    I also tried to use the "window.print()" command with the "execute javascript" action, but the page turns out really messy.

    Is there a better way to print pages using construct 3 that I'm not aware of?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is there a better way to print pages using construct 3 that I'm not aware of?

    I'm going to assume that you'll need to print different cards at different times for different players and that you're going to want these cards in a high resolution. Here's my initial thoughts on how I'd tackle this:

    1. Have a MYSQL database that contains all of the information needed for each possible card including images.

    2. Have C3 do an ajax call to a php script that selects the cards from the database depending on what the POST parameters from the AJAX call is.

    3. Have the php script use one of the pdf libraries available to build a pdf file containing the cards in the proper layout.

    4. Once the php script builds the pdf file, have it reply to the AJAX call with the location of that pdf file and then, C3 provides an external link to it. Once it's displayed in a browser, the end user can decide what to do with it.

    Two minor details. I've only worked with one pdf library and while it does work and the print quality is what you'd expect from a pdf, it's essentially it's own programming language. Getting that set up would be a chore. And, getting rid of the pdf file after a period of time would require some forethought. Of course, you could e-mail it to the player with php and delete it immediately.

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