Class TMessaging

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TMessaging = class(TObject)

Description

Message system to communicate between native code (Pascal) and Java on Android. Use through auto-created Messaging singleton. On other platforms than Android, right now it simply does nothing — messsages are not send anywhere.

To make this work:

This is used automatically by various engine classes like TGooglePlayGames, TAds, TAnalytics, TInAppPurchases.

Hierarchy

  • TObject
  • TMessaging

Overview

Methods

Public constructor Create;
Public destructor Destroy; override;
Public procedure Send(const Strings: array of string);
Public class function BoolToStr(const Value: boolean): string;
Public class function TimeToStr(const Value: TFloatTime): string;

Properties

Public property OnReceive: TMessageReceivedEventList read FOnReceive;
Public property Log: boolean read FLog write FLog default false;

Description

Methods

Public constructor Create;
 
Public destructor Destroy; override;
 
Public procedure Send(const Strings: array of string);

Send a message to our Java integration code.

Public class function BoolToStr(const Value: boolean): string;

Convert boolean to 'true' or 'false' string, which will be understood correctly by the Java components receiving the messages.

Public class function TimeToStr(const Value: TFloatTime): string;

Convert float time (in seconds) to integer miliseconds, which are understood correctly by the Java components receiving the messages.

Properties

Public property OnReceive: TMessageReceivedEventList read FOnReceive;

Callbacks called when new message from Java is received.

Public property Log: boolean read FLog write FLog default false;

Log each message send/received from/to Java. Note that this is sometimes quite verbose, and it also allows cheaters to easier debug what happens in your game (e.g. how to fake getting some achievement), so in general don't leave it "on" in production.


Generated by PasDoc 0.14.0.