10-15-2020, 04:13 AM | #1 |
Connoisseur
Posts: 50
Karma: 66200
Join Date: Oct 2020
Location: Germany, Rhein-Main
Device: PocketBook Touch HD 3
|
Currently porting the SGT Puzzle collection, need some coding help
Hi,
I bought a Pocketbook Touch HD 3 start of this year, and I used the covid lockdown to look into the PocketBook SDK, and ported the open source "Simon Tatham's Portable Puzzle collection" to my device. By looking at several code repositories with other PocketBook apps that I found at GitHub and elsewhere, I made some quite good progress and am now at a stage where it is turning into a serious and usable app: https://github.com/SteffenBauer/PocketPuzzles (MIT License, so completely open source and free, no commercial interest at all, just personal enthusiasm) To further progress with developing the app, I have some questions: - Is there anything comparable to Menus and Dialogs in the SDK for Buttons? So far I low-level coded buttons by drawing bitmaps, catching screen tap events and checking if the x/y coordinates are within the button bitmap. - I'd like to switch the game chooser screen to a scrolled area, similiar to the book browser library. There are functions like `AddScrolledArea` in `inkview.h`, but I'm unsure how to use this exactly. Is there example code somewhere? - There is a special type of menu (for example when long-tapping a book in the home screen) that opens with some kind of 'arrow' pointing to the tapped object. What object in the SDK is this? - One big element that is still missing in my app is individual configuration of game parameters. There is something like `ConfigEditor` in the SDK, but I'm completely unsure if I can use this, or if I need to low-code manual configuration. Would be really great if somebody could help me out, thanks a lot for answers! |
10-15-2020, 08:41 AM | #2 |
Guru
Posts: 766
Karma: 625812
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
|
That project sounds very interesting.
I can't help with the specific questions but there are some pocketbook programming projects at Sourceforge which could probably give some more insights. To name a few that could help with your project. https://github.com/pmartin/pocketbook-demo https://github.com/blchinezu/pocketbook-coolreader https://github.com/yuryfdr/pbtk |
Advert | |
|
10-15-2020, 09:31 AM | #3 | |
Connoisseur
Posts: 50
Karma: 66200
Join Date: Oct 2020
Location: Germany, Rhein-Main
Device: PocketBook Touch HD 3
|
Quote:
The code at `yuryfdr/pbtk` indeed hints that there is no high-level button interface in the SDK, so buttons need to be coded low-level. By the way, my app is actually quite usable so far with only few things missing (as mentioned the main missing thing is individual config, there are pre-configured presets for all games), and I have included a compiled binary at `build/SGTPuzzles.app`. I'd also be very glad for people who try it out (installation of course on own risk) and report bugs or improvement tips. Either as issue reports at GitHub, or here in this thread. I'm also interested if the app works on other devices than the Touch HD 3. I would update my top post to include a list of devices where it also works. |
|
10-15-2020, 10:00 AM | #4 |
Groupie
Posts: 177
Karma: 100516
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
|
I had a go with a couple of games on my PB631, and think that Towers didn't want to accept my right solution (bug of the puzzle, whatever....)
Anyway, that means that the app runs ok on the device. No crash, no display problem, fine for HD. I also did a quick search on github for "pocketbook". I got 294 matches. Many are not relevant (several e.g. seem to interpret PocketBook as one of several variations of a chinese electronic wallet app for android), but there are beyond the three links mentioned above. Maybe you were there too. For instance, I ran into this, which appears to implement a button with low level drawing operations. Which is anyway not a proof that an API method is missing. |
10-15-2020, 10:11 AM | #5 |
Connoisseur
Posts: 50
Karma: 66200
Join Date: Oct 2020
Location: Germany, Rhein-Main
Device: PocketBook Touch HD 3
|
Cool to see that it works also on another device
I'm not quite sure what happened in your round with the Tower puzzle, how exactly did it not accept your solution? Was the "Puzzles is solved!" popup missing? If this happens again, could you make a screenshot? Yeah, my GitHub repository for this app is currently not very much known and has no watchers or stars, so when searching for "PocketBook" it appears somewhere very late on page 26 or so... It appears quite at the top when sorting by "Recently Updated". |
Advert | |
|
10-15-2020, 10:13 AM | #6 |
Guru
Posts: 766
Karma: 625812
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
|
Congrats, it is a nice addon to the PB devices.
Tested it on PB 631 and PB 740, working fine so far. Some games need a manual thought, something like this: https://www.chiark.greenend.org.uk/~...doc/index.html |
10-15-2020, 10:16 AM | #7 | |
Connoisseur
Posts: 50
Karma: 66200
Join Date: Oct 2020
Location: Germany, Rhein-Main
Device: PocketBook Touch HD 3
|
Quote:
|
|
10-15-2020, 10:59 AM | #8 |
Guru
Posts: 766
Karma: 625812
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
|
Found it. Had only a quick look into everything without going deeper before.
|
10-15-2020, 12:06 PM | #9 | |
Groupie
Posts: 177
Karma: 100516
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
|
Quote:
|
|
10-15-2020, 12:27 PM | #10 |
Groupie
Posts: 177
Karma: 100516
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
|
|
10-15-2020, 12:42 PM | #11 |
Groupie
Posts: 177
Karma: 100516
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
|
deleted
Last edited by EastEriq; 10-15-2020 at 12:55 PM. |
10-15-2020, 03:16 PM | #12 |
Groupie
Posts: 177
Karma: 100516
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
|
Small redrawing bugs:
|
10-16-2020, 03:47 AM | #13 |
Connoisseur
Posts: 50
Karma: 66200
Join Date: Oct 2020
Location: Germany, Rhein-Main
Device: PocketBook Touch HD 3
|
|
10-16-2020, 08:44 AM | #14 | |
Connoisseur
Posts: 50
Karma: 66200
Join Date: Oct 2020
Location: Germany, Rhein-Main
Device: PocketBook Touch HD 3
|
Quote:
I searched a little bit more in GitHub, and might have made progress towards my initial questions, could be of interest to also other PocketBook app developers: a) https://github.com/pmartin/plop-reader : I found something there called "ContextMenu", this could be the solution to my third question (the 'special' menus pointing to an object) b) https://github.com/svn2github/pocket...master/memorum : This looks like a project using the ConfigEditor. |
|
10-18-2020, 08:03 AM | #15 |
Zealot
Posts: 121
Karma: 156515
Join Date: Oct 2019
Device: KT, KPW4, PB740-2
|
For context menu, and scrollable list of bitmap entries:
https://github.com/ezdiy/arm-pocketb...nkview.h#L1800 The modal dialog (icon + text + 1-3 buttons beneath): https://github.com/ezdiy/arm-pocketb...nkview.h#L1849 + there are some other utilities (progress bars and such). For the rest, you're left with the drawing primitives (ie FillAreaRect + DrawString and such). |
Tags |
app, programming, puzzles, sgt puzzles |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Simon Tatham's portable puzzle collection? | Biep | Kobo Developer's Corner | 6 | Yesterday 07:04 PM |
Introducing Sgt. Steve | Sgt Steve | Introduce Yourself | 2 | 03-14-2013 05:32 PM |