Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - eri0o

#2401
Ok. I think I figured. There's a property I didn't knew called TopItem.

Code: ags

int VisibleItemCount(this ListBox*){
  int d =  this.ItemCount - this.TopItem-1;
  if(d < this.RowCount){
    return d;
  } 
  return this.RowCount;
}
#2402
Yes. I recorded a video - I really suck at writing... Notice the empty slot on the end.

#2403
Manual is wrong again then it's not, you and I are saying the same thing with different wording:

https://github.com/adventuregamestudio/ags-manual/wiki/ListBox#rowcount

QuoteRowCount
readonly int ListBox.RowCount
Gets the number of rows that can be shown within the list box. This depends on the size of the list box, and does not depend on how many items are actually stored in the list box.

This property is read-only. To change the row count, adjust the height of the list box.

Example:

Display("You can currently see %d items from the listbox's contents", lstSaveGames.RowCount);
will display the number of rows that the listbox can display.

Edit: I did another test. I get the functionality described in the manual but I get a 0 on the first room load. Wait, now I see you and I talked about the same thing. The manual is correct.

Still, I don't know how to know if the page is scrolled.

Edit2:
Code: ags

_LIST BOX_
[ item a ]
[ item b ]
[ item c ]
[        ]
[        ]
[        ]
[        ]
__________


For a list box presented on the screen like the one "sketched" above, I need something that returns me 3, be the listbox scrolled or not. For the above, RowCount returns me 7.
#2404
ItemCount gives me the total items in a ListBox, RowCount gives me total number of rows in a ListBox. But ListBoxes can be scrolled. Is there a way to get the number of items actually shown in a ListBox ?
#2405
Hey cat! That's cool! If you want to try with the apk, you just get it on your phone and place the game there. Probably what CW linked there works fine.

For your case I think you should go with the phone you have. I have dipped my toes in two vertical games and made them 180x320. They are linked in my signature.

Some recent phones are coming with even more elongated screens - my phone 18.5:9. But I still think 16:9 is fine.

If you want to build your own .apk, I have released every Android Studio project I used on GitHub. I couldn't figure out how to write well the README though, so everyone who tried did hit a rock at some point and messaged me, so any hit just write me up or hit an issue button on GitHub.
#2406
There are many websites to buy domains, I currently really like the interface of the one from Google -> https://domains.google/#/ .

This is not a must, and you can sure be really happy by focusing only in a single game storefront. Having your own platform is only relevant for long term.
#2407
I think you misread, so I will explain. You create a website, can be on a free host, like  Tumblr, GitHub Pages, WordPress, ... Then you upload your game to itch.io, gamejolt, Steam, ... Then you add links on your website to the other platforms. I do recommend paying for a domain, it's usually just 10 USD or less, per year, but in case the free host goes down for whatever reason, you move your website to a different host seamlessly.
#2409
You could have your own website and provide links yourself to the different store fronts you have your game available. I think this works well for the long run.
#2410
I need to know before the click if the thing will actually be clickable by ProcessClick, with this information I could invalidate the ocluded interactives.

Edit: I created a issue for this.

Since this problem is more relevant for GUIs and things hidden by GUIs, I will solve by filtering out points that , when hit with GUI.GetAtScreenXY return a value different than null and are not GUI controls, and for GUI Controls, check if the owning GUI matches.

Edit2: Fixed and new release.  8-)

Edit3: Added a way to filter things out as per artium request. I also added enter as click just on the demo global script for ease of testing it out.

Edit4: Added support for list box!



Edit5: Now intermediary points of a slider are available too! Also fixed a crash that happened in the previous version.



Edit6: Added support for InvWindow and Inventory Items!

#2411
Hey Monsieur OUXX, I added a thing on the subject and added keyboard and gamepad mention on the first line, see if it's clearer now. :)

I have an issue I couldn't quite figure out yet which is when there's a clickable GUI on top of some stuff on screen, if someone has ideas or want to fork and pull request on GitHub a solution :P
#2413
Hey! Necro up! The sockets plugin used here, where can one download latest version?  :-D
#2414
Are you doing this for a museum or interactive exposition?

For non Google Play Android, the latest is fine. For now, it's best to disable threaded audio.

Resolution depends of style. Do you mean aspect ratio?
#2415
I don't know this module but in my game I use regular view with a pre animated rain animation and just play it either on a big object or in a GUI.
#2416
I will try to figure out how to filter things out. Each block of the algorithm is also exposed if someone wants to do anything creative with them too. :)

I really want people to try it out because there may be lots of use cases and bugs that I haven't predicted here.

Edit: I need to figure out how to navigate list GUI controls.
#2417
Thanks Slasher! The use case I have in mind should be clearer soon. The two step build of property creation and attribution, is so one could apply the same properties in different GUIs easily.
#2418
Hello,

I made something to allow resizing a GUI like this:



To use, you need to create a TextGUI, in the example, this TextGUI is named gNinePieceExample, and add each image for it



It works like this, you need to set the GUI as resizable somewhere, like game start for the GUI you want

Code: ags

gGui1.SetResizableProperties(
  ResizableGUI.Create(
    gNinePieceExample.AsTextWindow,
    /* horizontal resize graphic */ 1,
    /* vertical resize graphic */ 2,
    /* top left resize graphic */ 3, 
    /* top right resize graphic */ 4, 
    /* bottom left resize graphic */ 5, 
    /* bottom right resize graphic */ 6, 
    /* move cursor graphic */ 7, 
    /* is click resizable */ true
  )
);


The Code and Example project is on GitHub.

I need help figuring out if this API makes sense or not. I want to use this with another thing I am making.
#2419
General Discussion / Re: the blender 3D thread
Sat 03/08/2019 22:56:22
Looking Great Jack!
#2420
ArrowSelect version 0.6.1

Select things using arrows keys or joystick hat, module for in point and click games made with Adventure Game Studio.

Requires AGS 3.6.1



Get Latest Release arrowselect.scm | GitHub Repo | Demo Windows

Note: This module doesn't deal with printing things on screen, but if you want to do this, you may find it provides some helpful functions with the Interactives abstraction.

Basic usage

For basic usage with Keyboard, in your global script, add at game_start:

Code: ags
    ArrowSelect.enableKeyboardArrows();

Usage with joystick

If you are using a joystick or gamepad plugin, you will need to implement your own function to deal with. An example for hat is below.

Code: ags
    //pressed a hat
    void pressedPov(int pov){
      if(pov == ePOVCenter){
      } else if(pov == ePOVDown){
        ArrowSelect.moveCursorDirection(eDirectionDown);
      } else if(pov == ePOVLeft){
        ArrowSelect.moveCursorDirection(eDirectionLeft);
      } else if(pov == ePOVRight){
        ArrowSelect.moveCursorDirection(eDirectionRight);
      } else if(pov == ePOVUp){
        ArrowSelect.moveCursorDirection(eDirectionUp);
      } else if(pov == ePOVDownLeft){
        ArrowSelect.moveCursorDirection(eDirectionDownLeft);
      } else if(pov == ePOVDownRight){
        ArrowSelect.moveCursorDirection(eDirectionDownRight);
      } else if(pov == ePOVUpLeft){
        ArrowSelect.moveCursorDirection(eDirectionUpLeft);
      } else if(pov == ePOVUpRight){
        ArrowSelect.moveCursorDirection(eDirectionUpRight);
      }
      return;
    }

What are Interactives ?

Interactives are things on screen that the player can interact with.
These are Objects, Characters, Hotspots, and GUI Controls like buttons and others.
This module only cares for their type, and a position that is similar to the thing center that mouse can click.

Note that some gotchas apply, for example, if you have three different Hotspots areas that map to the same Hotspot, instead of finding out they are different, it will erroneously find a point in the center of them.
So if you have, for example, two TVs in your background, that have the same interaction, create two different hostpots for them and just map the same interaction function to both, otherwise this module will fail.

Code: ags
enum InteractiveType{
  eInteractiveTypeNothing = eLocationNothing,
  eInteractiveTypeObject = eLocationObject,
  eInteractiveTypeCharacter = eLocationCharacter,
  eInteractiveTypeHotspot = eLocationHotspot,
  eInteractiveTypeGUIControl,
  eInteractiveTypeGUI,
};

managed struct Interactive{
  int x;
  int y;
  int ID;
  InteractiveType type;
};

ArrowSelect API

bool ArrowSelect.moveCursorDirection(CharacterDirection dir)
Moves cursor to the interactive available at a direction. Returns true if the cursor is successfully moved.

Interactive* ArrowSelect.getNearestInteractivePointAtDirection(CharacterDirection dir)
Get the nearest interactive available at a direction. Returns null if there is none.

Point* ArrowSelect.getNearestInteractivePointAtDirection(CharacterDirection dir)
Get point of the nearest interactive available at a direction. Returns null if there is none.

bool attribute ArrowSelect.UseMouseAsOrigin
If true, Mouse position is used as origin in getNearestInteractiveAtDirection and related functions. Default is true.

Point* attribute ArrowSelect.Origin
Point used as origin if UseMouseAsOrigin is false.

void filterInteractiveType(InteractiveType interactiveType, InteractiveFilter filter=0)
Filters or not a interactive type for cursor moveCursorDirection and getNearestInteractivePointAtDirection.

bool ArrowSelect.areKeyboardArrowsEnable()
Returns true if regular keyboard arrows are enabled for cursor movements.

bool ArrowSelect.enableKeyboardArrows(bool isKeyboardArrowsEnabled = 1)
Enables or disables (by passing false) regular keyboard arrows handled by this module.

Triangle* ArrowSelect.triangleFromOriginAngleAndDirection(Point* origin, int direction, int spreadAngle=90)
Returns a Triangle instance with one point at the origin points and the two other points separated by spreadAngle, and at the direction angle

int ArrowSelect.distanceInteractivePoint(Interactive* s, Point* a)
Retuns the distance between an interactive and a point.

Interactive* ArrowSelect.closestValidInteractivePoint(Interactive* Interactives[], Point* a)
Returns the closest interactive to a point.

Interactive*[] ArrowSelect.getInteractives()
Get a list of all interactives on screen.

bool ArrowSelect.isInteractiveInsideTriangle(Interactive* p, Point* a, Point* b, Point* c)
Returns true if an interactive is inside a triangle defined by three points.

Interactive*[] ArrowSelect.whichInteractivesInTriangle(Interactive* Interactives[], Point* a, Point* b, Point* c)
Returns a list of which triangles are inside a triangle defined by three points.

Implementation details

This is just the detail on how things works on this module

Problem
By using keyboard arrow keys or joystick directional hat, select between
clickable things on screen.

Solution
When the player press an arrow button do as follow:

1 .get the x,y position of each thing on screen,

2 .select only things on arrow button direction (example:at right of current
  cursor position, when player press right arrow button),

3 .calculate distance from cursor to things there, and get what has the smaller
  distance

Solution details
For 2, the key is figuring out the right angle and then create a triangle that
extends to screen border, the things inside the triangle can be figured with the
function below

https://stackoverflow.com/a/9755252/965638
Code: C++
public static bool PointInTriangle(Point p, Point p0, Point p1, Point p2)
{
    var s = p0.Y * p2.X - p0.X * p2.Y + (p2.Y - p0.Y) * p.X + (p0.X - p2.X) * p.Y;
    var t = p0.X * p1.Y - p0.Y * p1.X + (p0.Y - p1.Y) * p.X + (p1.X - p0.X) * p.Y;

   if ((s < 0) != (t < 0))
    return false;

var A = -p1.Y * p2.X + p0.Y * (p2.X - p1.X) + p0.X * (p1.Y - p2.Y) + p1.X * p2.Y;

return A < 0 ?
        (s <= 0 &amp;&amp; s + t >= A) :
        (s >= 0 &amp;&amp; s + t <= A);
}

Author

Made by eri0o

License

Distributed under MIT license. See LICENSE for more information.
SMF spam blocked by CleanTalk