CN114237569A - Installation package generation method, device, equipment and storage medium - Google Patents

Installation package generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN114237569A
CN114237569A CN202111461869.2A CN202111461869A CN114237569A CN 114237569 A CN114237569 A CN 114237569A CN 202111461869 A CN202111461869 A CN 202111461869A CN 114237569 A CN114237569 A CN 114237569A
Authority
CN
China
Prior art keywords
behavior
attribute
gravity
attribute value
collision
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111461869.2A
Other languages
Chinese (zh)
Inventor
邓斌
杜博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Lewo Wuxian Technology Co ltd
Original Assignee
Beijing Lewo Wuxian Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Lewo Wuxian Technology Co ltd filed Critical Beijing Lewo Wuxian Technology Co ltd
Priority to CN202111461869.2A priority Critical patent/CN114237569A/en
Publication of CN114237569A publication Critical patent/CN114237569A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computing Systems (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention provides an installation package generation method, an installation package generation device, installation package generation equipment and a storage medium, wherein a created physical behavior manager object can be added to a created view object for displaying a target view of a user icon; creating a gravity behavior class, setting an attribute value of a direction attribute and an attribute value of an angle attribute of the gravity behavior class, and obtaining a gravity behavior object; creating an object class and setting an attribute value of an element attribute of the object class to obtain an object; establishing a coordinate manager class, and setting an attribute value of an accelerometer attribute of the coordinate manager class to obtain a coordinate manager object; adding the gravity behavior object to a physical behavior manager object, and adding the object to the view object and the gravity behavior object respectively to obtain a source program of the social application; and compiling the source program to obtain an installation package of the social application. Based on the processing, the display modes of the matched pages can be enriched, the interestingness of the matched interface is increased, and the user experience is improved.

Description

Installation package generation method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for generating an installation package.
Background
With the rapid development of computer technology, there are more and more APPs (applications) providing various functions to users. For example, a user (which may be referred to as a first user) may communicate with other users (which may be referred to as second users) through a social application. The social application may also recommend a second user to the user while the first user is using the social application. For example, the social application may display a matching page that displays icons of a plurality of second users in a list. When the first user needs to communicate with one of the second users, the icon of the second user can be clicked. Accordingly, the social application may display a chat page with the second user.
Disclosure of Invention
The embodiment of the invention aims to provide an installation package generation method, device, equipment and storage medium, which are used for enriching the display mode of a matching page of social application, increasing the interestingness of a matching interface and improving the user experience. The specific technical scheme is as follows:
in a first aspect of the present invention, there is provided an installation package generating method, where the method includes:
creating a physical behavior manager object;
creating a view object for displaying a target view of a user icon and adding the physical behavior manager object to the view object;
creating a gravity behavior class, and setting an attribute value of a direction attribute and an attribute value of an angle attribute of the gravity behavior class to obtain a gravity behavior object; wherein an attribute value of the direction attribute represents a speed of movement of the user icon in the target view; the attribute value of the angle attribute represents a moving direction of a user icon in the target view;
creating an object class, and setting attribute values of element attributes of the object class to obtain an object; wherein the object represents the user icon; the attribute value of the element attribute represents the size of the user icon, the display content in the user icon, and the initial position of the user icon in the target view;
creating a coordinate manager class, and setting an attribute value of an accelerometer attribute of the coordinate manager class to obtain a coordinate manager object; wherein the attribute value of the accelerometer attribute represents: the method comprises the steps that an accelerometer of a terminal obtains time intervals of acceleration of the terminal on each coordinate axis of a terminal coordinate system; the coordinate manager object is used for acquiring the acceleration of the terminal on each coordinate axis of a terminal coordinate system according to the time interval, calculating the current gravity angle of the terminal based on the acquired acceleration, and assigning the calculated gravity angle as the current attribute value of the angle attribute; the current gravity angle of the terminal represents the current included angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction;
adding the gravity behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object to obtain a source program of a social application;
compiling the source program to obtain an installation package of the social application; the social application is used for displaying the user icon in the target view by taking the direction represented by the current attribute value of the angle attribute as a motion direction, taking the motion speed represented by the attribute value of the direction attribute as an initial motion speed, and taking the position represented by the attribute value of the element attribute as an initial position.
Optionally, before adding the gravity behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object to obtain a source program of a social application, the method further includes:
creating a collision behavior class, and setting an attribute value of a boundary attribute and an attribute value of a collision attribute of the collision behavior class to obtain a collision behavior object; wherein the attribute value of the boundary attribute represents the boundary of a target area supporting the collision behavior of the user icon in the target view; the attribute value of the collision attribute indicates whether collision behavior between user icons is supported in the target area and whether collision behavior between the user icons and the boundary of the target area is supported;
the adding the gravity behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object to obtain a source program of a social application includes:
adding the gravity behavior object and the collision behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object and the collision behavior object, respectively, to obtain a source program of a social application.
Optionally, the boundary of a target area supporting the collision behavior of the user icon in the target view is the boundary of the target view; and collision behaviors between the user icons supported in the target area and between the user icons and the boundary of the target area.
Optionally, before adding the gravity behavior object and the collision behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object and the collision behavior object, respectively, to obtain a source program of a social application, the method further includes:
creating a dynamic behavior class, and setting an attribute value of an elastic coefficient attribute and an attribute value of a friction coefficient attribute of the dynamic behavior class to obtain a dynamic behavior object; wherein the attribute value of the elasticity coefficient attribute represents a numerical value of a change of a movement speed of the user icon after the collision behavior and a movement direction relative to the movement direction before the collision behavior; the attribute value of the friction coefficient attribute represents a numerical value of a decrease in the movement speed of the user icon when the user icon moves in the target view by a preset number of pixel points;
the adding the gravity behavior object and the collision behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object and the collision behavior object, respectively, to obtain a source program of a social application, including:
adding the gravity behavior object, the collision behavior object and the dynamic behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object, the dynamic behavior object and the collision behavior object, respectively, to obtain a source program of a social application.
In a second aspect of the present invention, there is provided an installation package generating apparatus, including:
the manager creating module is used for creating a physical behavior manager object;
a view creation module for creating a view object for displaying a target view of a user icon and adding the physical behavior manager object to the view object;
the gravity behavior creating module is used for creating a gravity behavior class, setting an attribute value of a direction attribute and an attribute value of an angle attribute of the gravity behavior class and obtaining a gravity behavior object; wherein an attribute value of the direction attribute represents a speed of movement of the user icon in the target view; the attribute value of the angle attribute represents a moving direction of a user icon in the target view;
the object creating module is used for creating an object class and setting the attribute value of the element attribute of the object class to obtain an object; wherein the object represents the user icon; the attribute value of the element attribute represents the size of the user icon, the display content in the user icon, and the initial position of the user icon in the target view;
the coordinate manager creating module is used for creating a coordinate manager class and setting an attribute value of an accelerometer attribute of the coordinate manager class to obtain a coordinate manager object; wherein the attribute value of the accelerometer attribute represents: the method comprises the steps that an accelerometer of a terminal obtains time intervals of acceleration of the terminal on each coordinate axis of a terminal coordinate system; the coordinate manager object is used for acquiring the acceleration of the terminal on each coordinate axis of a terminal coordinate system according to the time interval, calculating the current gravity angle of the terminal based on the acquired acceleration, and assigning the calculated gravity angle as the current attribute value of the angle attribute; the current gravity angle of the terminal represents the current included angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction;
the adding module is used for adding the gravity behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object to obtain a source program of a social application;
the compiling module is used for compiling the source program to obtain an installation package of the social application; the social application is used for displaying the user icon in the target view by taking the direction represented by the current attribute value of the angle attribute as a motion direction, taking the motion speed represented by the attribute value of the direction attribute as an initial motion speed, and taking the position represented by the attribute value of the element attribute as an initial position.
Optionally, the apparatus further comprises:
a collision behavior creating module, configured to create a collision behavior class and set an attribute value of a boundary attribute and an attribute value of a collision attribute of the collision behavior class to obtain a collision behavior object before the adding module performs adding the gravity behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object to obtain a source program of a social application; wherein the attribute value of the boundary attribute represents the boundary of a target area supporting the collision behavior of the user icon in the target view; the attribute value of the collision attribute indicates whether collision behavior between user icons is supported in the target area and whether collision behavior between the user icons and the boundary of the target area is supported;
the adding module is specifically configured to add the gravity behavior object and the collision behavior object to the physical behavior manager object, add the object to the view object, and add the object to the gravity behavior object and the collision behavior object, respectively, to obtain a source program of a social application.
Optionally, the boundary of a target area supporting the collision behavior of the user icon in the target view is the boundary of the target view; and collision behaviors between the user icons supported in the target area and between the user icons and the boundary of the target area.
Optionally, the apparatus further comprises:
the dynamic behavior creating module is used for creating a dynamic behavior class and setting an attribute value of an elastic coefficient attribute and an attribute value of a friction coefficient attribute of the dynamic behavior class to obtain a dynamic behavior object before the adding module adds the gravity behavior object and the collision behavior object to the physical behavior manager object, adds the object to the view object and respectively adds the object to the gravity behavior object and the collision behavior object to obtain a source program of social application; wherein the attribute value of the elasticity coefficient attribute represents a numerical value of a change of a movement speed of the user icon after the collision behavior and a movement direction relative to the movement direction before the collision behavior; the attribute value of the friction coefficient attribute represents a numerical value of a decrease in the movement speed of the user icon when the user icon moves in the target view by a preset number of pixel points;
the adding module is specifically configured to add the gravity behavior object, the collision behavior object, and the dynamic behavior object to the physical behavior manager object, add the object to the view object, and add the object to the gravity behavior object, the dynamic behavior object, and the collision behavior object, respectively, to obtain a source program of a social application.
The embodiment of the invention also provides electronic equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the installation package generation method steps when executing the program stored in the memory.
The embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of the installation package generation method described above are implemented.
An embodiment of the present invention further provides a computer program product containing instructions, which when run on a computer, causes the computer to execute any one of the installation package generation methods described above.
The embodiment of the invention has the following beneficial effects:
according to the installation package generation method provided by the embodiment of the invention, a physical behavior manager object can be created, a view object used for displaying a target view of a user icon is created, and the physical behavior manager object is added to the view object; creating a gravity behavior class, and setting an attribute value of a direction attribute and an attribute value of an angle attribute of the gravity behavior class to obtain a gravity behavior object; the attribute value of the direction attribute represents the movement speed of the user icon in the target view; the attribute value of the angle attribute represents the moving direction of the user icon in the target view; creating an object class, and setting attribute values of element attributes of the object class to obtain an object; the object represents a user icon; the attribute value of the element attribute represents the size of the user icon, the display content in the user icon and the initial position of the user icon in the target view; creating a coordinate manager class, and setting an attribute value of an accelerometer attribute of the coordinate manager class to obtain a coordinate manager object; the attribute values of the accelerometer attributes represent: the method comprises the steps that an accelerometer of a terminal obtains time intervals of acceleration of the terminal on each coordinate axis of a terminal coordinate system; the coordinate manager object is used for acquiring the acceleration of the terminal on each coordinate axis of the terminal coordinate system according to a time interval, calculating the gravity angle of the terminal based on the acquired acceleration, and assigning the calculated gravity angle as the current attribute value of the angle attribute; the gravity angle of the terminal represents the included angle between the designated coordinate axis in the terminal coordinate system and the horizontal direction; adding the gravity behavior object to a physical behavior manager object, adding the object to a view object, and adding the object to the gravity behavior object to obtain a source program of the social application; compiling the source program to obtain an installation package of the social application; the social application is used for displaying the user icon in the target view by taking the direction represented by the current attribute value of the angle attribute as the moving direction, taking the moving speed represented by the attribute value of the direction attribute as the initial moving speed and taking the position represented by the attribute value of the element attribute as the initial position.
Based on the above processing, a gravity behavior object and an object are added to the view object of the target view of the social application, the social application may determine the current gravity angle of the terminal through the coordinate manager object and assign the current gravity angle as the current attribute value of the angle attribute of the gravity behavior object, the attribute value of the angle attribute may represent the running direction of the user icon represented by the object, and accordingly, the user icon may be displayed in the target view with the direction represented by the current gravity angle of the terminal as the running direction and with the running speed represented by the attribute value of the direction attribute as the initial running speed. Because the current gravity angle of the terminal represents the included angle between the current designated coordinate axis and the horizontal direction in the terminal coordinate system, the included angle can represent the direction of the terminal relative to the ground, namely, when the included angle between the current designated coordinate axis and the horizontal direction of the terminal coordinate system is changed, namely, the direction of the terminal relative to the ground is changed, according to the motion state of a real object under the action of gravity, the user icon is displayed in the matching page of the social application, the display mode of the matching page is enriched, the interestingness of the matching interface is increased, and the user experience can be improved.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by referring to these drawings.
Fig. 1 is a flowchart of an installation package generating method according to an embodiment of the present invention;
fig. 2(a) is a schematic diagram of a terminal coordinate system according to an embodiment of the present invention;
fig. 2(b) is a schematic diagram of another terminal coordinate system provided in the embodiment of the present invention;
fig. 3(a) is a schematic diagram of a matching page of a social application according to an embodiment of the present invention;
FIG. 3(b) is a diagram illustrating a matching page of another social application according to an embodiment of the present invention;
fig. 4 is a flowchart of another installation package generation method according to an embodiment of the present invention;
fig. 5 is a flowchart of another installation package generation method according to an embodiment of the present invention;
fig. 6 is a structural diagram of an installation package generating apparatus according to an embodiment of the present invention;
fig. 7 is a structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived from the embodiments given herein by one of ordinary skill in the art, are within the scope of the invention.
Referring to fig. 1, fig. 1 is a flowchart of an installation package generation method provided in an embodiment of the present invention, where the method may include the following steps:
s101: a physical behavior manager object is created.
S102: a view object for displaying a target view of the user icon is created and a physical behavior manager object is added to the view object.
S103: and creating a gravity behavior class, and setting the attribute value of the direction attribute and the attribute value of the angle attribute of the gravity behavior class to obtain a gravity behavior object.
Wherein the attribute value of the direction attribute represents the movement speed of the user icon in the target view; the attribute value of the angle attribute represents a direction of movement of the user icon in the target view.
S104: and creating an object class, and setting attribute values of element attributes of the object class to obtain the object.
Wherein the object represents a user icon. The attribute values of the element attributes represent the size of the user icon, the display content in the user icon, and the initial position of the user icon in the target view.
S105: and creating a coordinate manager class, and setting an attribute value of the accelerometer attribute of the coordinate manager class to obtain a coordinate manager object.
Wherein the attribute value of the accelerometer attribute represents: the accelerometer of the terminal acquires the time interval of the acceleration of the terminal on each coordinate axis of the terminal coordinate system. And the coordinate manager object is used for acquiring the acceleration of the terminal on each coordinate axis of the terminal coordinate system according to the time interval, calculating the current gravity angle of the terminal based on the acquired acceleration, and assigning the calculated gravity angle as the current attribute value of the angle attribute. The current gravity angle of the terminal represents the current included angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction.
S106: and adding the gravity behavior object to a physical behavior manager object, adding the object to a view object, and adding the object to the gravity behavior object to obtain a source program of the social application.
S107: and compiling the source program to obtain an installation package of the social application.
The social application is used for displaying the user icon in the target view by taking the direction represented by the current attribute value of the angle attribute as the moving direction, taking the moving speed represented by the attribute value of the direction attribute as the initial moving speed, and taking the position represented by the attribute value of the element attribute as the initial position.
Based on the installation package generation method provided by the embodiment of the invention, the view object of the target view of the social application is added with the gravity behavior object and the object, the social application can determine the current gravity angle of the terminal through the coordinate manager object and assign the current gravity angle as the current attribute value of the angle attribute of the gravity behavior object, the attribute value of the angle attribute can represent the running direction of the user icon represented by the object, correspondingly, the direction represented by the current gravity angle of the terminal can be taken as the running direction, and the user icon can be displayed in the target view by taking the running speed represented by the attribute value of the direction attribute as the initial running speed. Because the current gravity angle of the terminal represents the included angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction, the included angle can represent the direction of the terminal relative to the ground, namely when the included angle between the specified coordinate axis of the terminal coordinate system and the horizontal direction changes, namely the direction of the terminal relative to the ground changes, according to the motion state of a real object under the action of gravity, the user icon is displayed in the matching page of the social application, the display mode of the matching page is enriched, the interestingness of the matching interface is increased, and the user experience can be improved.
With respect to steps S101 and S102, while the user uses the social application, the social application may recommend other users to the user. For example, the social application may display user icons of the recommended other users in a matching page.
The display content in the user icon may include a user avatar, a user name, a user tag, and the like, and the user tag may be an interest tag set for the user, for example, a movie, a sport, a travel, and the like.
In order to enable the social application to display the user icon in the matching page, a matching page for displaying the user icon may be created for the social application, that is, a view object for displaying a target view of the user icon is created, and the view object is a source program of the matching page of the social application.
In order to be able to display the user icons in the matching page according to the motion state of the object under the action of the real gravity, a physical behavior manager object for managing physical behaviors may be created and added to the view object of the target view. The physical behavior may include gravity behavior, collision behavior, and dynamic behavior in the subsequent embodiments.
The size of the target view may be the size of the display interface of the social application. Or the target view may also be a designated area in the display interface of the social application, and accordingly, other areas in the display interface of the social application except for the target view may display matching manners for the user to perform matching, such as voice matching, video matching, and the like.
Illustratively, if the operating system on which the social application runs is the IOS operating system, a UIDynamicAnimator object may be created as a physical behavior manager object and a View object may be created as a View object for the target View, adding the UIDynamicAnimator object to the View object.
For step S103, in order to display the user icon in the matching page of the social application according to the motion state of the real object under the action of gravity, a gravity behavior object may be created for the social application, and the gravity behavior object is used to simulate the motion state of the real object under the action of gravity.
In one implementation, the gravity behavior class may be created first. And then, setting the attribute value of the direction attribute and the attribute value of the angle attribute of the gravity behavior class to obtain a gravity behavior object. The attribute value of the direction attribute of the gravity behavior object represents the movement speed of the user icon in the target view, and the attribute value of the angle attribute of the gravity behavior object represents the movement direction of the user icon in the target view.
For example, a UIGravityBehavior class may be created, and an attribute value of a gravityDirection attribute (i.e., a direction attribute in an embodiment of the present invention) of the gravity behavior class may be set to CGVectorMake (a, b). a represents the moving speed of the user icon in the horizontal direction when the user icon moves in the target view, and b represents the moving speed of the user icon in the vertical direction. In order to display the user icon in the target view according to the motion state in which the real object falls downward by gravity, a may be set to 0, that is, the user icon does not move in the horizontal direction but moves only in the vertical direction.
In addition, an attribute value of an angle attribute (i.e., an angle attribute in the embodiment of the present invention) of the gravity behavior class may also be set, where the attribute value of the angle attribute is an included angle between a specified coordinate axis in the terminal coordinate system and the horizontal direction. For example, if the attribute value of the angle attribute is set to pi/2, the obtained gravity behavior object is a longitudinal gravity behavior object, and the attribute value of the angle attribute of the gravity behavior object represents the movement direction of the user icon in the target view, that is, the user icon can be moved in the vertical direction.
With respect to step S104, in order to display the user icon in the created target view, an object representing the user icon may also be created. In one implementation, an object class may be created and then the attribute values of the element attributes of the object class are set to arrive at the object. The attribute values of the element attributes represent the size of the user icon, the display content in the user icon, and the initial position of the user icon in the target view.
The initial position of the user icon in the target view is a position in the target view before the user icon moves, for example, the initial position may be an upper position in the target view when the user icon is displayed in the target view according to a movement state in which the real object falls down by gravity.
Then, the gravity behavior object may be added to the physical behavior manager object, and the object may be added to the target view and the gravity behavior object, and a source program of the social application may be obtained. Furthermore, the source program of the social application is compiled, and the installation package of the social application can be obtained.
Correspondingly, when the social application runs, the direction represented by the attribute value of the angle attribute of the gravity behavior object is taken as the motion direction, the motion speed represented by the attribute value of the direction attribute is taken as the initial motion speed, and the position represented by the attribute value of the element attribute is taken as the initial position, so that the user icon is displayed in the target view.
Based on the processing, the user icons can be displayed in the matching pages of the social application according to the motion state of the real object under the action of gravity, the display modes of the matching pages are enriched, the interestingness of the matching interface is increased, and the user experience can be improved.
With respect to step S105, the terminal is a device, such as a mobile phone, a tablet computer, or the like, where the social application is executed. The direction of the terminal relative to the ground is changed, and the direction of the terminal relative to the ground can be represented by an included angle between a designated coordinate axis in a terminal coordinate system and the horizontal direction, that is, the included angle between the designated coordinate axis in the terminal coordinate system and the horizontal direction is also changed. When the direction of the terminal relative to the ground is changed, if the user icon still moves according to the direction represented by the attribute value of the angle attribute of the gravity behavior object as the movement direction, at this time, the user icon cannot be displayed in the target view according to the movement state that the real object falls downward under the action of gravity.
Illustratively, referring to fig. 2(a), the orientation of the terminal with respect to the ground is vertical, and the terminal coordinate system includes an X-axis, a Y-axis, and a Z-axis. The X axis is parallel to the edge of the upper side of the display screen of the terminal, the Y axis is parallel to the edge of the left side of the display screen of the terminal, and the upward direction perpendicular to the display screen of the terminal is the positive direction of the Z axis. The designated coordinate axis in the terminal coordinate system is the Y-axis.
In order to display the user icon in the target view according to the motion state of the real object falling downward under the action of gravity, the direction represented by the attribute value of the angle attribute of the gravity behavior object is the opposite direction of the Y axis. When the direction of the terminal relative to the ground is the vertical direction, the Y axis of the terminal coordinate system is vertical to the horizontal direction, and when the user icon moves in the opposite direction of the Y axis in the target view, the user icon can be displayed in the target view according to the movement state that the real object falls downwards under the action of gravity.
When the direction of the terminal is changed, as shown in fig. 2(b), the direction of the terminal relative to the ground is not vertical, the Y-axis of the terminal coordinate system is not vertical to the horizontal direction, and when the user icon moves in the target view in the opposite direction of the Y-axis, the user icon cannot be displayed in the target view according to the movement state that the real object falls downward under the action of gravity.
Therefore, after the direction of the terminal relative to the ground needs to be obtained and changed, the included angle between the designated coordinate axis in the terminal coordinate system and the horizontal direction needs to be obtained, and then the movement direction of the user icon in the target view is adjusted according to the obtained included angle.
In one implementation, a coordinate manager class may be created, an attribute value of an accelerometer attribute of the coordinate manager class may be set, a coordinate manager object may be obtained, and an accelerometer of the terminal may be turned on. The time interval may be set by the skilled person based on experience, for example, the time interval may be 0.2 seconds, or the time interval may also be 0.3 seconds, but is not limited thereto.
For example, a CMMotionManager class may be created, an attribute value of an accelerometerepdateInterval (ACCELEROMETER Interval) attribute is set to 0.2, and an accelerometer is turned on. Wherein, the accelerometerUpdateInterval attribute is an accelerometer attribute in the embodiment of the present invention, and the attribute value of the accelerometerUpdateInterval attribute represents: the time interval of the acceleration of the accelerometer acquisition terminal on each coordinate axis of the terminal coordinate system, that is, the time interval of the acceleration of the accelerometer acquisition terminal on each coordinate axis of the terminal coordinate system is set to 0.2 second.
Correspondingly, when the social application runs on the terminal, the coordinate manager object can acquire the acceleration of the terminal on each coordinate axis of the terminal coordinate system according to the time interval through the accelerometer of the terminal, and calculate the current gravity angle of the terminal based on the acquired acceleration, wherein the current gravity angle of the terminal represents the current included angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction.
For example, the accelerometer of the terminal can be turned on by calling the startAccelerometereterUpdateToQueue: withHandler: method. The coordinate manager object may obtain, through the accelerometer, the acceleration of the terminal on each coordinate axis of the terminal coordinate system, and the method may return CMAccelerometerData (accelerometer data) including the acceleration of the terminal on each coordinate axis of the terminal coordinate system. Then, the current gravity angle of the terminal is calculated through the atan2(y, x) function. atan2 is an arctangent function, X represents the acceleration of the terminal on the X-axis of the terminal coordinate system, Y represents the acceleration of the terminal on the Y-axis of the terminal coordinate system, and since Y is negative when the acceleration is downward, Y needs to be inverted (i.e., -Y) when calculating the current gravitational angle of the terminal.
Further, the calculated current gravity angle of the terminal can be assigned as the current attribute value of the angle attribute. Subsequently, the user icon may be moved in the target view with the direction represented by the current attribute value of the angle attribute as the moving direction. The method comprises the steps that the movement direction of a user icon in a target view is adjusted based on the included angle between the current designated coordinate axis in a terminal coordinate system and the horizontal direction, when the direction of the terminal relative to the ground changes, the user icon is displayed in a matching page of the social application according to the movement state of a real object falling downwards under the action of gravity, the display mode of the matching page is enriched, the interestingness of the matching interface is increased, and the user experience can be improved.
For step S106 and step S107, the gravity behavior object may be added to the physical behavior manager object, and the object may be added to the gravity behavior object and the view object of the target view, so that the source program of the social application may be obtained. For example, an addBehavior method may be called to add a gravity behavior object to the UIDynamicAnimator object, an addItem method may be called to add an object to the gravity behavior object, and the object may be added to the view object, and then, a source program of the social application may be compiled, and an installation package of the social application may be obtained.
Based on the processing, the user icon can be displayed in the matching page of the social application according to the motion state of the real object under the action of gravity, and when the direction of the terminal relative to the ground is changed, the user icon still moves in the matching page of the social application according to the motion state of the real object under the action of gravity, so that the display mode of the matching page is enriched, the interestingness of the matching interface is increased, and the user experience can be improved.
For example, referring to fig. 3(a), when the direction of the terminal with respect to the ground is a vertical direction, the user icon may move in a vertical direction in the target view according to a motion state of the real object falling downward under the action of gravity, and when the direction of the terminal with respect to the ground is changed, referring to fig. 3(b), the user icon may still move in a vertical direction in the target view according to a motion state of the real object falling downward under the action of gravity.
In an embodiment of the present invention, on the basis of fig. 1, referring to fig. 4, before step S106, the method may further include the following steps:
s108: and creating a collision behavior class, and setting the attribute value of the boundary attribute and the attribute value of the collision attribute of the collision behavior class to obtain a collision behavior object.
The attribute value of the boundary attribute represents the boundary of a target area supporting the collision behavior of the user icon in the target view; the attribute values of the collision attributes indicate whether or not collision behavior between the user icons is supported in the target region and whether or not collision behavior between the user icons and the boundary of the target region is supported.
Accordingly, step S106 may include the steps of:
s1061: and adding the gravity behavior object and the collision behavior object to a physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object and the collision behavior object respectively to obtain a source program of the social application.
In order to simulate the motion state of a real object falling downwards under the action of gravity, a plurality of user icons displayed in a target view can be set to have collision behavior. In one implementation, a collision behavior class may be created, and an attribute value of a boundary attribute and an attribute value of a collision attribute of the collision behavior class may be set to obtain a collision behavior object.
In one embodiment of the invention, the boundary of the target area supporting the collision behavior of the user icon in the target view is the boundary of the target view; collision behavior between the user icons supported in the target area and collision behavior between the user icons and the boundary of the target area.
The collision behavior between the user icons means that the distance between the boundaries of the two user icons is smaller than a first preset distance. The collision behavior between the user icon and the boundary of the target area means that the distance between the boundary of the user icon and the boundary of the target area is smaller than a second preset distance. The first preset distance and the second preset distance may be the same, or the first preset distance and the second preset distance may be different.
Illustratively, a UICollisionBehavior class may be created, and the attribute value of the translatesreferenceboundsintobroundabout attribute (i.e., the boundary attribute in the embodiment of the present invention) is set to YES, that is, the boundary of the target view is taken as the boundary of the target region supporting the collision behavior, that is, any region in the target view supports the collision behavior. In addition, the attribute value of the collisionMode attribute (i.e., the collision attribute in the embodiment of the present invention) may also be set to uicollisionbehaviomodeeventing, that is, the collision behavior between the user icons is supported, and the collision behavior between the user icons and the boundary of the target area is set.
Then, an addBehavior (addition behavior) method can be called to add the collision behavior object and the gravity behavior object to the UIDynamicAnimator object, an addItem (addition project) method is called to add the object to the collision behavior object and the gravity behavior object, and the object is added to the view object, and then the source program of the social application is compiled, and the installation package of the social application can be obtained.
In an embodiment of the present invention, on the basis of fig. 4, referring to fig. 5, before step S1061, the method may further include the following steps:
s109: and establishing a dynamic behavior class, and setting an attribute value of the elastic coefficient attribute and an attribute value of the friction coefficient attribute of the dynamic behavior class to obtain a dynamic behavior object.
And the attribute value of the elasticity coefficient attribute represents the value of the change of the movement speed of the user icon after the collision behavior and the movement direction relative to the movement direction before the collision behavior. The attribute value of the friction coefficient attribute represents a numerical value of a decrease in the movement speed of the user icon per a preset number of pixel points moved when the user icon moves in the target view.
Accordingly, step S1061 may include the steps of:
s10611: and adding the gravity behavior object, the collision behavior object and the dynamic behavior object to a physical behavior manager object, adding the object to a view object, and respectively adding the object to the gravity behavior object, the dynamic behavior object and the collision behavior object to obtain a source program of the social application.
When the real object falls down under the action of gravity, the moving speed of the real object is changed due to the influence of friction (for example, the friction between the object and the air), and after the real object collides, the moving direction and the moving speed of the real object are both changed due to the influence of the elastic force.
In order to simulate the motion state of a real object falling downwards under the action of gravity and the motion state of the real object after collision more truly, a dynamic behavior class can be created, and the attribute value of the elastic coefficient attribute and the attribute value of the friction coefficient attribute of the dynamic behavior class are set to obtain a dynamic behavior object.
For example, a UIDynamicItemBehavior (dynamic behavior) class may be created, an attribute value of an elasticity attribute (i.e., an elastic coefficient attribute in the embodiment of the present invention) may be set, and an attribute value of a frication attribute (i.e., a friction coefficient attribute in the embodiment of the present invention) may be set.
The dynamic behavior object is used for reducing the movement speed of the user icon by a preset numerical value when the user icon moves in the target view and moves by a preset number of pixel points. The preset number and the preset numerical value may be set by a technician according to experience, for example, the movement speed is reduced by 100 pixels/second for every 500 pixels moved by the user icon.
The dynamic behavior object is also used for changing the movement speed and the movement direction of the user icon after the user icon is subjected to collision behavior. For example, when the user icon has a collision behavior, a direction opposite to a movement direction of the user icon before the collision behavior may be used as the movement direction of the user icon after the collision behavior.
Or when the user icon collides with the boundary of the target area, determining an incident line along the movement direction of the user icon before the collision, taking an included angle between the incident line and the normal line of the boundary of the target area as an incident angle, determining a reflected line corresponding to the incident line according to a reflection principle, and determining the direction of the reflected line as the movement direction of the user icon after the collision.
When a user icon (which may be referred to as a user icon I) and another user icon (which may be referred to as a user icon II) have a collision behavior, an incident line along a movement direction of the user icon I before the collision behavior occurs may be determined, an included angle between a normal line of the movement direction of the user icon II before the collision behavior occurs is used as an incident angle, a reflection line corresponding to the incident line may be determined according to a reflection principle, and a direction of the reflection line may be determined as a movement direction of the user icon I after the collision behavior occurs. The method for adjusting the moving direction of the user icon two is similar to the method for adjusting the moving direction of the user icon one.
In addition, after the user icon has collided, the movement speed of the user icon may be reduced, for example, the movement speed of the user icon may be adjusted to three fifths, or one-half, of the movement speed before the collision of the user icon occurs.
Then, an addBehavior (addition behavior) method can be called to add the collision behavior object, the dynamic behavior object and the gravity behavior object to the UIDynamicAnimator object, an addItem (addition item) method is called to add the object to the collision behavior object, the dynamic behavior object and the gravity behavior object, and add the object to the view object, and then the source program of the social application is compiled, so that the installation package of the social application can be obtained.
Based on the processing, the motion state of the user icon in the target view can be adjusted according to the change of the motion state of the real object when influenced by the friction force and the change of the motion state of the real object after collision when influenced by the elastic force, so that the display mode of the matching page is enriched, the interestingness of the matching interface is increased, and the user experience can be improved.
Corresponding to the method embodiment of fig. 1, referring to fig. 6, fig. 6 is a structural diagram of an installation package generating apparatus according to an embodiment of the present invention, where the apparatus includes:
a manager creating module 601, configured to create a physical behavior manager object;
a view creation module 602, configured to create a view object for displaying a target view of a user icon, and add the physical behavior manager object to the view object;
a gravity behavior creating module 603, configured to create a gravity behavior class, and set an attribute value of a direction attribute and an attribute value of an angle attribute of the gravity behavior class to obtain a gravity behavior object; wherein an attribute value of the direction attribute represents a speed of movement of the user icon in the target view; the attribute value of the angle attribute represents a moving direction of a user icon in the target view;
an object creating module 604, configured to create an object class and set an attribute value of an element attribute of the object class to obtain an object; wherein the object represents the user icon; the attribute value of the element attribute represents the size of the user icon, the display content in the user icon, and the initial position of the user icon in the target view;
a coordinate manager creating module 605, configured to create a coordinate manager class, and set an attribute value of an accelerometer attribute of the coordinate manager, to obtain a coordinate manager object; wherein the attribute value of the accelerometer attribute represents: the method comprises the steps that an accelerometer of a terminal obtains time intervals of acceleration of the terminal on each coordinate axis of a terminal coordinate system; the coordinate manager object is used for acquiring the acceleration of the terminal on each coordinate axis of a terminal coordinate system according to the time interval, calculating the current gravity angle of the terminal based on the acquired acceleration, and assigning the calculated gravity angle as the current attribute value of the angle attribute; the current gravity angle of the terminal represents the current included angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction;
an adding module 606, configured to add the gravity behavior object to the physical behavior manager object, add the object to the view object, and add the object to the gravity behavior object, so as to obtain a source program of a social application;
a compiling module 607, configured to compile the source program to obtain an installation package of the social application; the social application is used for displaying the user icon in the target view by taking the direction represented by the current attribute value of the angle attribute as a motion direction, taking the motion speed represented by the attribute value of the direction attribute as an initial motion speed, and taking the position represented by the attribute value of the element attribute as an initial position.
Optionally, the apparatus further comprises:
a collision behavior creating module, configured to create a collision behavior class and set an attribute value of a boundary attribute and an attribute value of a collision attribute of the collision behavior class to obtain a collision behavior object before the adding module 606 performs adding the gravity behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object to obtain a source program of a social application; wherein the attribute value of the boundary attribute represents the boundary of a target area supporting the collision behavior of the user icon in the target view; the attribute value of the collision attribute indicates whether collision behavior between user icons is supported in the target area and whether collision behavior between the user icons and the boundary of the target area is supported;
the adding module 606 is specifically configured to add the gravity behavior object and the collision behavior object to the physical behavior manager object, add the object to the view object, and add the object to the gravity behavior object and the collision behavior object, respectively, to obtain a source program of a social application.
Optionally, the boundary of a target area supporting the collision behavior of the user icon in the target view is the boundary of the target view; and collision behaviors between the user icons supported in the target area and between the user icons and the boundary of the target area.
Optionally, the apparatus further comprises:
a dynamic behavior creating module, configured to create a dynamic behavior class and set an attribute value of an elastic coefficient attribute and an attribute value of a friction coefficient attribute of the dynamic behavior class to obtain a dynamic behavior object before the adding module 606 performs adding the gravity behavior object and the collision behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object and the collision behavior object, respectively, to obtain a source program of a social application; wherein the attribute value of the elasticity coefficient attribute represents a numerical value of a change of a movement speed of the user icon after the collision behavior and a movement direction relative to the movement direction before the collision behavior; the attribute value of the friction coefficient attribute represents a numerical value of a decrease in the movement speed of the user icon when the user icon moves in the target view by a preset number of pixel points;
the adding module 606 is specifically configured to add the gravity behavior object, the collision behavior object, and the dynamic behavior object to the physical behavior manager object, add the object to the view object, and add the object to the gravity behavior object, the dynamic behavior object, and the collision behavior object, respectively, to obtain a source program of a social application.
Based on the installation package generation device provided by the embodiment of the invention, the view object of the target view of the social application is added with the gravity behavior object and the object, the social application can determine the current gravity angle of the terminal through the coordinate manager object and assign the current gravity angle as the current attribute value of the angle attribute of the gravity behavior object, the attribute value of the angle attribute can represent the running direction of the user icon represented by the object, correspondingly, the direction represented by the current gravity angle of the terminal can be taken as the running direction, and the running speed represented by the attribute value of the direction attribute is taken as the initial running speed to display the user icon in the target view. Because the current gravity angle of the terminal represents the included angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction, the included angle can represent the direction of the terminal relative to the ground, namely when the included angle between the specified coordinate axis of the terminal coordinate system and the horizontal direction changes, namely the direction of the terminal relative to the ground changes, according to the motion state of a real object under the action of gravity, the user icon is displayed in the matching page of the social application, the display mode of the matching page is enriched, the interestingness of the matching interface is increased, and the user experience can be improved.
An embodiment of the present invention further provides an electronic device, as shown in fig. 7, including a processor 701, a communication interface 702, a memory 703 and a communication bus 704, where the processor 701, the communication interface 702, and the memory 703 complete mutual communication through the communication bus 704,
a memory 703 for storing a computer program;
the processor 701 is configured to implement the following steps when executing the program stored in the memory 703:
creating a physical behavior manager object;
creating a view object for displaying a target view of a user icon and adding the physical behavior manager object to the view object;
creating a gravity behavior class, and setting an attribute value of a direction attribute and an attribute value of an angle attribute of the gravity behavior class to obtain a gravity behavior object; wherein an attribute value of the direction attribute represents a speed of movement of the user icon in the target view; the attribute value of the angle attribute represents a moving direction of a user icon in the target view;
creating an object class, and setting attribute values of element attributes of the object class to obtain an object; wherein the object represents the user icon; the attribute value of the element attribute represents the size of the user icon, the display content in the user icon, and the initial position of the user icon in the target view;
creating a coordinate manager class, and setting an attribute value of an accelerometer attribute of the coordinate manager class to obtain a coordinate manager object; wherein the attribute value of the accelerometer attribute represents: the method comprises the steps that an accelerometer of a terminal obtains time intervals of acceleration of the terminal on each coordinate axis of a terminal coordinate system; the coordinate manager object is used for acquiring the acceleration of the terminal on each coordinate axis of a terminal coordinate system according to the time interval, calculating the current gravity angle of the terminal based on the acquired acceleration, and assigning the calculated gravity angle as the current attribute value of the angle attribute; the current gravity angle of the terminal represents the current included angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction;
adding the gravity behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object to obtain a source program of a social application;
compiling the source program to obtain an installation package of the social application; the social application is used for displaying the user icon in the target view by taking the direction represented by the current attribute value of the angle attribute as a motion direction, taking the motion speed represented by the attribute value of the direction attribute as an initial motion speed, and taking the position represented by the attribute value of the element attribute as an initial position.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any one of the installation package generation methods described above.
In yet another embodiment, a computer program product containing instructions is provided, which when run on a computer causes the computer to perform any of the installation package generation methods in the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the computer-readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to them, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. An installation package generation method, the method comprising:
creating a physical behavior manager object;
creating a view object for displaying a target view of a user icon and adding the physical behavior manager object to the view object;
creating a gravity behavior class, and setting an attribute value of a direction attribute and an attribute value of an angle attribute of the gravity behavior class to obtain a gravity behavior object; wherein an attribute value of the direction attribute represents a speed of movement of the user icon in the target view; the attribute value of the angle attribute represents a moving direction of a user icon in the target view;
creating an object class, and setting attribute values of element attributes of the object class to obtain an object; wherein the object represents the user icon; the attribute value of the element attribute represents the size of the user icon, the display content in the user icon, and the initial position of the user icon in the target view;
creating a coordinate manager class, and setting an attribute value of an accelerometer attribute of the coordinate manager class to obtain a coordinate manager object; wherein the attribute value of the accelerometer attribute represents: the method comprises the steps that an accelerometer of a terminal obtains time intervals of acceleration of the terminal on each coordinate axis of a terminal coordinate system; the coordinate manager object is used for acquiring the acceleration of the terminal on each coordinate axis of a terminal coordinate system according to the time interval, calculating the current gravity angle of the terminal based on the acquired acceleration, and assigning the calculated gravity angle as the current attribute value of the angle attribute; the current gravity angle of the terminal represents the current included angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction;
adding the gravity behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object to obtain a source program of a social application;
compiling the source program to obtain an installation package of the social application; the social application is used for displaying the user icon in the target view by taking the direction represented by the current attribute value of the angle attribute as a motion direction, taking the motion speed represented by the attribute value of the direction attribute as an initial motion speed, and taking the position represented by the attribute value of the element attribute as an initial position.
2. The method of claim 1, wherein before adding the gravity behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object, resulting in a source program for a social application, the method further comprises:
creating a collision behavior class, and setting an attribute value of a boundary attribute and an attribute value of a collision attribute of the collision behavior class to obtain a collision behavior object; wherein the attribute value of the boundary attribute represents the boundary of a target area supporting the collision behavior of the user icon in the target view; the attribute value of the collision attribute indicates whether collision behavior between user icons is supported in the target area and whether collision behavior between the user icons and the boundary of the target area is supported;
the adding the gravity behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object to obtain a source program of a social application includes:
adding the gravity behavior object and the collision behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object and the collision behavior object, respectively, to obtain a source program of a social application.
3. The method according to claim 2, wherein the boundary of the target area supporting the collision behavior of the user icon in the target view is the boundary of the target view; and collision behaviors between the user icons supported in the target area and between the user icons and the boundary of the target area.
4. The method of claim 2, wherein before adding the gravity behavior object and the collision behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object and the collision behavior object, respectively, resulting in a source program for a social application, the method further comprises:
creating a dynamic behavior class, and setting an attribute value of an elastic coefficient attribute and an attribute value of a friction coefficient attribute of the dynamic behavior class to obtain a dynamic behavior object; wherein the attribute value of the elasticity coefficient attribute represents a numerical value of a change of a movement speed of the user icon after the collision behavior and a movement direction relative to the movement direction before the collision behavior; the attribute value of the friction coefficient attribute represents a numerical value of a decrease in the movement speed of the user icon when the user icon moves in the target view by a preset number of pixel points;
the adding the gravity behavior object and the collision behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object and the collision behavior object, respectively, to obtain a source program of a social application, including:
adding the gravity behavior object, the collision behavior object and the dynamic behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object, the dynamic behavior object and the collision behavior object, respectively, to obtain a source program of a social application.
5. An installation package generation apparatus, characterized in that the apparatus comprises:
the manager creating module is used for creating a physical behavior manager object;
a view creation module for creating a view object for displaying a target view of a user icon and adding the physical behavior manager object to the view object;
the gravity behavior creating module is used for creating a gravity behavior class, setting an attribute value of a direction attribute and an attribute value of an angle attribute of the gravity behavior class and obtaining a gravity behavior object; wherein an attribute value of the direction attribute represents a speed of movement of the user icon in the target view; the attribute value of the angle attribute represents a moving direction of a user icon in the target view;
the object creating module is used for creating an object class and setting the attribute value of the element attribute of the object class to obtain an object; wherein the object represents the user icon; the attribute value of the element attribute represents the size of the user icon, the display content in the user icon, and the initial position of the user icon in the target view;
the coordinate manager creating module is used for creating a coordinate manager class and setting an attribute value of an accelerometer attribute of the coordinate manager class to obtain a coordinate manager object; wherein the attribute value of the accelerometer attribute represents: the method comprises the steps that an accelerometer of a terminal obtains time intervals of acceleration of the terminal on each coordinate axis of a terminal coordinate system; the coordinate manager object is used for acquiring the acceleration of the terminal on each coordinate axis of a terminal coordinate system according to the time interval, calculating the current gravity angle of the terminal based on the acquired acceleration, and assigning the calculated gravity angle as the current attribute value of the angle attribute; the current gravity angle of the terminal represents the current included angle between the specified coordinate axis in the terminal coordinate system and the horizontal direction;
the adding module is used for adding the gravity behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object to obtain a source program of a social application;
the compiling module is used for compiling the source program to obtain an installation package of the social application; the social application is used for displaying the user icon in the target view by taking the direction represented by the current attribute value of the angle attribute as a motion direction, taking the motion speed represented by the attribute value of the direction attribute as an initial motion speed, and taking the position represented by the attribute value of the element attribute as an initial position.
6. The apparatus of claim 5, further comprising:
a collision behavior creating module, configured to create a collision behavior class and set an attribute value of a boundary attribute and an attribute value of a collision attribute of the collision behavior class to obtain a collision behavior object before the adding module performs adding the gravity behavior object to the physical behavior manager object, adding the object to the view object, and adding the object to the gravity behavior object to obtain a source program of a social application; wherein the attribute value of the boundary attribute represents the boundary of a target area supporting the collision behavior of the user icon in the target view; the attribute value of the collision attribute indicates whether collision behavior between user icons is supported in the target area and whether collision behavior between the user icons and the boundary of the target area is supported;
the adding module is specifically configured to add the gravity behavior object and the collision behavior object to the physical behavior manager object, add the object to the view object, and add the object to the gravity behavior object and the collision behavior object, respectively, to obtain a source program of a social application.
7. The apparatus according to claim 6, wherein the boundary of the target area supporting the collision behavior of the user icon in the target view is the boundary of the target view; and collision behaviors between the user icons supported in the target area and between the user icons and the boundary of the target area.
8. The apparatus of claim 6, further comprising:
the dynamic behavior creating module is used for creating a dynamic behavior class and setting an attribute value of an elastic coefficient attribute and an attribute value of a friction coefficient attribute of the dynamic behavior class to obtain a dynamic behavior object before the adding module adds the gravity behavior object and the collision behavior object to the physical behavior manager object, adds the object to the view object and respectively adds the object to the gravity behavior object and the collision behavior object to obtain a source program of social application; wherein the attribute value of the elasticity coefficient attribute represents a numerical value of a change of a movement speed of the user icon after the collision behavior and a movement direction relative to the movement direction before the collision behavior; the attribute value of the friction coefficient attribute represents a numerical value of a decrease in the movement speed of the user icon when the user icon moves in the target view by a preset number of pixel points;
the adding module is specifically configured to add the gravity behavior object, the collision behavior object, and the dynamic behavior object to the physical behavior manager object, add the object to the view object, and add the object to the gravity behavior object, the dynamic behavior object, and the collision behavior object, respectively, to obtain a source program of a social application.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 4 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
CN202111461869.2A 2021-12-02 2021-12-02 Installation package generation method, device, equipment and storage medium Pending CN114237569A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111461869.2A CN114237569A (en) 2021-12-02 2021-12-02 Installation package generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111461869.2A CN114237569A (en) 2021-12-02 2021-12-02 Installation package generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114237569A true CN114237569A (en) 2022-03-25

Family

ID=80752835

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111461869.2A Pending CN114237569A (en) 2021-12-02 2021-12-02 Installation package generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114237569A (en)

Similar Documents

Publication Publication Date Title
TWI697840B (en) Resource allocation method, device and equipment
US10223176B1 (en) Event handler nodes for visual scripting
US9430142B2 (en) Touch-based gesture recognition and application navigation
US20160094705A1 (en) Message Read Confirmation Using Eye Tracking
US20240144628A1 (en) Methods and systems for generating digital objects for collecting data in a three-dimensional environment
CN108664461B (en) Automatic filling method and device for webpage form
CN109144370B (en) Screen capturing method, device, terminal and computer readable medium
US9785201B2 (en) Controlling images at mobile devices using sensors
AU2017334312B2 (en) Objective based advertisement placement platform
CN108829456A (en) Application program preloads method, apparatus, storage medium and terminal
CN109144392B (en) Method and device for processing gesture conflict and electronic equipment
CN111930442A (en) Page view loading method and device, storage medium and electronic equipment
CN107219983A (en) List display method and device
JP2021120867A (en) Fusion relation network construction method, fusion relation network construction device, electronic device, storage medium and program
CN104094199A (en) Input mapping regions
CN110914810B (en) Monkey testing method and terminal
KR102480515B1 (en) Method and system for generating and displaying three-dimensional digital assets for use in an online environment
CN111240622B (en) Drawing method and device
US20160018982A1 (en) Touch-Based Gesture Recognition and Application Navigation
CN114237569A (en) Installation package generation method, device, equipment and storage medium
CN108874141B (en) Somatosensory browsing method and device
CN107038176B (en) Method, device and equipment for rendering web graph page
CN113535990B (en) Method, device, storage medium and electronic equipment for determining multimedia content
CN108874270A (en) Show the sort method and relevant apparatus of object
CN109816485B (en) Page display method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination