CN111885365B - Method, device and equipment for realizing subtitles based on illusion engine and storage medium - Google Patents

Method, device and equipment for realizing subtitles based on illusion engine and storage medium Download PDF

Info

Publication number
CN111885365B
CN111885365B CN202010692818.XA CN202010692818A CN111885365B CN 111885365 B CN111885365 B CN 111885365B CN 202010692818 A CN202010692818 A CN 202010692818A CN 111885365 B CN111885365 B CN 111885365B
Authority
CN
China
Prior art keywords
level
caption
display content
subtitle
subtitles
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.)
Active
Application number
CN202010692818.XA
Other languages
Chinese (zh)
Other versions
CN111885365A (en
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.)
Shenzhen Realis Multimedia Technology Co Ltd
Original Assignee
Shenzhen Realis Multimedia 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 Shenzhen Realis Multimedia Technology Co Ltd filed Critical Shenzhen Realis Multimedia Technology Co Ltd
Priority to CN202010692818.XA priority Critical patent/CN111885365B/en
Priority to CN202210078696.4A priority patent/CN114500974B/en
Publication of CN111885365A publication Critical patent/CN111885365A/en
Application granted granted Critical
Publication of CN111885365B publication Critical patent/CN111885365B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/10Processing, recording or transmission of stereoscopic or multi-view image signals
    • H04N13/106Processing image signals
    • H04N13/172Processing image signals image signals comprising non-image signal components, e.g. headers or format information
    • H04N13/183On-screen display [OSD] information, e.g. subtitles or menus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/10Processing, recording or transmission of stereoscopic or multi-view image signals
    • H04N13/106Processing image signals
    • H04N13/167Synchronising or controlling image signals

Abstract

The invention relates to the field of virtual reality and discloses a method, a device, equipment and a storage medium for realizing subtitles based on a ghost engine. The method comprises the following steps: receiving first display content to be displayed through a function interface on a preset virtual caption display component, and inputting the first display content into a first-level caption; creating a secondary subtitle according to the primary subtitle, and synchronizing the first display content to the secondary subtitle; cutting the first display content through the secondary subtitles, and respectively inputting the cut display content into at least one tertiary subtitle created according to the secondary subtitles; and inputting the obtained three-level subtitles into the rolling block of the two-level subtitles, and controlling at least one three-level subtitle to display based on the first rolling parameter of the rolling block of the one-level subtitles and the second rolling parameter of the two-level subtitles so as to realize the sequential playing of the first display content. The invention can provide the subtitle function for the virtual application and enables the subtitle to exist in the virtual world.

Description

Method, device and equipment for realizing subtitles based on illusion engine and storage medium
Technical Field
The invention relates to the field of virtual reality, in particular to a method, a device, equipment and a storage medium for realizing subtitles based on a ghost engine.
Background
The illusion engine UE4 is the most open and most advanced real-time 3D authoring platform around the world, and is widely used for creating virtual scenes, and in the prior art, it implements mapping construction of virtual scenes based on the UE4, but the construction of the virtual scenes can only implement static mapping, especially in virtual implementation of subtitles, and when multiple display contents are needed to be implemented in a specific scene by static subtitle implementation, it needs multiple display subtitles, thus greatly occupying objects of the virtual scenes, affecting the operating space of the user, and the experience of the static subtitles for the user is not strong.
Disclosure of Invention
The invention mainly aims to solve the technical problem that the dynamic display of subtitles cannot be realized in the existing virtual reality scene.
The invention provides a subtitle realization method based on a ghost engine in a first aspect, which comprises the following steps:
receiving first display content to be displayed through a function interface on a preset virtual caption display component, wherein the virtual caption display component is an object which is created based on a phantom engine and has a caption display function, and comprises a first-level caption, a second-level caption and a third-level caption;
inputting the first display content into the primary caption, creating a secondary caption based on the primary caption, synchronizing the first display content to the secondary caption and adding the secondary caption to a scroll of the primary caption;
synchronizing the first display content to the second-level subtitles, cutting the first display content according to preset subtitle display rules to generate at least one third-level subtitle, and adding the at least one third-level subtitle to a rolling block of the second-level subtitles, wherein the third-level subtitle comprises a single-line third-level subtitle and a double-line third-level subtitle;
and controlling the at least one third-level caption to be displayed based on the first rolling parameter of the rolling block of the first-level caption and the second rolling parameter of the rolling block of the second-level caption so as to realize the sequential playing of the first display content.
Optionally, in a first implementation manner of the first aspect of the present invention, the cutting the first display content according to preset subtitle display rules to generate at least one tertiary subtitle, and adding the at least one tertiary subtitle to a scroll of the secondary subtitle includes:
analyzing the first display content to obtain the total line number of the first display content;
judging whether the total line number is larger than a preset line number threshold value or not;
if so, calling a caption cutting algorithm, cutting the first display content to obtain at least two display captions, creating at least two three-level captions based on the at least two display captions, and adding the at least two three-level captions into a rolling block of the two-level caption;
if not, creating a three-level caption with the caption display line number being the preset line number threshold, inputting the first display content into the three-level caption with the caption display line number being the preset line number threshold, and adding the three-level caption with the preset line number threshold into a rolling block of the two-level caption.
Optionally, in a second implementation manner of the first aspect of the present invention, the invoking a caption splitting algorithm to split the first display content to generate at least two tertiary captions, and adding the at least one tertiary caption to a scroll box of the secondary caption includes:
calculating the total number of bytes of the first display content;
judging whether the total byte number exceeds a first byte threshold value or not;
if not, creating a double-line three-level caption based on the second-level caption, and inputting the first display content into the double-line three-level caption through a preset function interface of the double-line three-level caption; adding the tertiary subtitles to a scroll of the secondary subtitles;
if so, creating at least two single-line three-level subtitles based on the two-level subtitles, and respectively inputting the first display content into the at least two single-line three-level subtitles through a preset function interface of the single-line three-level subtitles; adding the at least two single line tertiary subtitles to a scroll box of the secondary subtitles.
Optionally, in a third implementation manner of the first aspect of the present invention, the creating at least two single-line three-level subtitles based on the two-level subtitles, and inputting the first display content into the at least two single-line three-level subtitles through a preset function interface of the single-line three-level subtitles, respectively; adding the at least two single line tertiary subtitles to the scroll box of the secondary subtitles comprises:
creating an array based on the secondary caption, and storing the first display content to the array to obtain a second display content;
judging whether the second display content exceeds a second byte threshold value;
if the second display content does not exceed the second byte threshold, acquiring the second display content in the array, and creating a single-line three-level caption for the second display content;
and inputting the second display content into the single-line three-level subtitles and adding the single-line three-level subtitles into a rolling block of the two-level subtitles through a preset function interface of the single-line three-level subtitles.
Optionally, in a fourth implementation manner of the first aspect of the present invention, the creating at least two single-line three-level subtitles based on the two-level subtitles, and inputting the first display content into the at least two single-line three-level subtitles through a preset function interface of the single-line three-level subtitles, respectively; adding the at least two single line tertiary subtitles to a scroll box of the secondary subtitles, further comprising:
if the second display content exceeds the second byte threshold, obtaining the first N bytes of the second display content through a preset GetSubstring function interface, and cutting the first N bytes from the second display content through a preset Split function interface to obtain a third display content and a fourth display content, wherein N is equal to the second byte threshold, and the fourth display content is a byte except the third display content in the second display content;
continuing to cut the fourth display content to obtain fifth display content with the length of M bytes not greater than the second byte threshold;
and creating M +1 single-line three-level subtitles based on the fifth display content, respectively inputting the M +1 display contents into the corresponding single-line three-level subtitles through a preset function interface of the single-line three-level subtitles, and adding the M +1 single-line three-level subtitles into a rolling block of the two-level subtitles.
Optionally, in a fifth implementation manner of the first aspect of the present invention, the controlling, based on the first scroll parameter of the scroll box of the primary subtitle and the second scroll parameter of the scroll box of the secondary subtitle, the at least one tertiary subtitle to be displayed so as to sequentially play the first display content includes:
selecting one of the at least two secondary subtitles to display, and setting other secondary subtitles to be in a state to be displayed;
when the display of the three-level caption in the currently displayed two-level caption is controlled to be completed through the second rolling parameter, controlling the two-level caption to roll through the first rolling parameter;
and selecting the corresponding next to-be-scrolled secondary caption from the secondary captions in the to-be-displayed state based on the first scrolling parameter, and sequentially playing the first display content.
Optionally, in a sixth implementation manner of the first aspect of the present invention, after the controlling the at least one third-level subtitle to be displayed based on the first scroll parameter of the scroll box of the first-level subtitle and the second scroll parameter of the scroll box of the second-level subtitle to realize that the first display content is played in sequence, the method further includes:
receiving text content to be displayed, and naming the text content as first display content;
and manufacturing a subtitle body based on the first display content and setting the subtitle based on the user requirement.
The invention provides a caption realizing device based on a ghost engine in a second aspect, which comprises:
the receiving module is used for receiving first display content to be displayed through a function interface on a preset virtual caption display component, wherein the virtual caption display component is an object which is created based on a virtual engine and has a caption display function, and comprises a first-level caption, a second-level caption and a third-level caption;
the creating module is used for inputting the first display content into the primary caption, creating a secondary caption based on the primary caption, synchronizing the first display content to the secondary caption and adding the secondary caption to a scroll block of the primary caption;
the cutting module is used for synchronizing the first display content to the second-level subtitles, cutting the first display content according to preset subtitle display rules to generate at least one third-level subtitle and adding the at least one third-level subtitle to a rolling block of the second-level subtitles, wherein the third-level subtitle comprises a single-line third-level subtitle and a double-line third-level subtitle;
and the playing module is used for controlling the at least one third-level caption to be displayed based on the first rolling parameter of the rolling block of the first-level caption and the second rolling parameter of the rolling block of the second-level caption so as to realize the sequential playing of the first display content.
Optionally, in a first implementation manner of the second aspect of the present invention, the cutting module includes:
the analysis unit is used for analyzing the first display content to obtain the total line number of the first display content;
the judging unit is used for judging whether the total line number is larger than a preset line number threshold value or not;
the cutting unit is used for calling a caption cutting algorithm when the total line number is larger than a preset line number threshold value, cutting the first display content to obtain at least two display captions, creating at least two three-level captions based on the at least two display captions, and adding the at least two three-level captions into a rolling block of the two-level caption;
and the creating unit is used for creating a three-level subtitle with the subtitle display line number being the preset line number threshold when the total line number is smaller than the preset line number threshold, inputting the first display content into the three-level subtitle with the subtitle display line number being the preset line number threshold, and adding the three-level subtitle with the preset line number threshold into the rolling block of the two-level subtitle.
Optionally, in a second implementation manner of the second aspect of the present invention, the cutting unit is specifically configured to:
calculating the total number of bytes of the first display content;
judging whether the total byte number exceeds a first byte threshold value or not;
if not, creating a double-line three-level caption based on the second-level caption, and inputting the first display content into the double-line three-level caption through a preset function interface of the double-line three-level caption; adding the tertiary subtitles to a scroll of the secondary subtitles;
if so, creating at least two single-line three-level subtitles based on the two-level subtitles, and respectively inputting the first display content into the at least two single-line three-level subtitles through a preset function interface of the single-line three-level subtitles; adding the at least two single line tertiary subtitles to a scroll box of the secondary subtitles.
Optionally, in a third implementation manner of the second aspect of the present invention, the creating unit is specifically configured to:
creating an array based on the secondary caption, and storing the first display content to the array to obtain a second display content;
judging whether the second display content exceeds a second byte threshold value;
if the second display content does not exceed the second byte threshold, acquiring the second display content in the array, and creating a single-line three-level caption for the second display content;
and inputting the second display content into the single-line three-level subtitles and adding the single-line three-level subtitles into a rolling block of the two-level subtitles through a preset function interface of the single-line three-level subtitles.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the creating unit is further specifically configured to:
if the second display content exceeds the second byte threshold, obtaining the first N bytes of the second display content through a preset GetSubstring function interface, and cutting the first N bytes from the second display content through a preset Split function interface to obtain a third display content and a fourth display content, wherein N is equal to the second byte threshold, and the fourth display content is a byte except the third display content in the second display content;
continuing to cut the fourth display content to obtain fifth display content with the length of M bytes not greater than the second byte threshold;
and creating M +1 single-line three-level subtitles based on the fifth display content, respectively inputting the M +1 display contents into the corresponding single-line three-level subtitles through a preset function interface of the single-line three-level subtitles, and adding the M +1 single-line three-level subtitles into a rolling block of the two-level subtitles.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the playing module is specifically configured to:
selecting one of the at least two secondary subtitles to display, and setting other secondary subtitles to be in a state to be displayed;
when the display of the three-level caption in the currently displayed two-level caption is controlled to be completed through the second rolling parameter, controlling the two-level caption to roll through the first rolling parameter;
and selecting the corresponding next to-be-scrolled secondary caption from the secondary captions in the to-be-displayed state based on the first scrolling parameter, and sequentially playing the first display content.
Optionally, in a sixth implementation manner of the second aspect of the present invention, the apparatus further includes:
the receiving module is used for receiving the text content to be displayed and naming the text content as first display content;
and the setting module is used for manufacturing a subtitle body based on the first display content and setting the subtitle based on the user requirement.
A third aspect of the present invention provides a subtitle implementing apparatus based on a ghost engine, including: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line;
the at least one processor invokes the instructions in the memory to cause the illusion engine based subtitle implementation device to perform the above-described illusion engine based subtitle implementation method.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to execute the above-described ghost engine-based subtitle implementing method.
In the technical scheme provided by the invention, a function interface on a preset virtual caption display component is used for receiving first display content to be displayed and inputting the first display content into a first-level caption; creating a secondary subtitle according to the primary subtitle, and synchronizing the first display content to the secondary subtitle; cutting the first display content through the secondary subtitles, and respectively inputting the cut display content into at least one tertiary subtitle created according to the secondary subtitles; and inputting the obtained three-level subtitles into the rolling block of the two-level subtitles, and controlling at least one three-level subtitle to display based on the first rolling parameter of the rolling block of the one-level subtitles and the second rolling parameter of the two-level subtitles so as to realize the sequential playing of the first display content. The subtitle function can be provided for the virtual application, and the subtitle exists in the virtual world in reality.
Drawings
Fig. 1 is a schematic diagram of a first embodiment of a method for implementing a caption based on a ghost engine according to the present invention;
fig. 2 is a schematic diagram of a second embodiment of the illusion engine-based subtitle implementation method of the present invention;
fig. 3 is a schematic diagram of a third embodiment of a method for implementing a subtitle based on a ghost engine according to the present invention;
fig. 4 is a schematic diagram of a fourth embodiment of a method for implementing a subtitle based on a ghost engine according to the present invention;
fig. 5 is a schematic diagram of a fifth embodiment of a method for implementing a subtitle based on a ghost engine according to the present invention;
fig. 6 is a schematic diagram of a first embodiment of a caption implementing device based on a ghost engine according to the present invention;
fig. 7 is a schematic diagram of a second embodiment of a caption implementing device based on a ghost engine according to the present invention;
fig. 8 is a schematic diagram of an embodiment of a caption implementing device based on a ghost engine according to the present invention.
Detailed Description
The embodiment of the invention provides a method, a device, equipment and a storage medium for realizing subtitles based on a ghost engine, wherein in the technical scheme of the invention, a function interface on a preset virtual subtitle display component is used for receiving first display content to be displayed and inputting the first display content into a first-level subtitle; creating a secondary subtitle according to the primary subtitle, and synchronizing the first display content to the secondary subtitle; cutting the first display content through the secondary subtitles, and respectively inputting the cut display content into at least one tertiary subtitle created according to the secondary subtitles; and inputting the obtained three-level subtitles into the rolling block of the two-level subtitles, and controlling at least one three-level subtitle to display based on the first rolling parameter of the rolling block of the one-level subtitles and the second rolling parameter of the two-level subtitles so as to realize the sequential playing of the first display content. The subtitle function can be provided for the virtual application, and the subtitle exists in the virtual world in reality.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
For convenience of understanding, a detailed flow of the embodiment of the present invention is described below, and referring to fig. 1, a first embodiment of a method for implementing a subtitle based on a ghost engine according to the embodiment of the present invention includes:
101. receiving first display content to be displayed through a function interface on a preset virtual caption display component, wherein the virtual caption display component is an object which is created based on a phantom engine and has a caption display function, and comprises a first-level caption, a second-level caption and a third-level caption;
it is to be understood that the execution subject of the present invention may be a caption implementing device based on a ghost engine, and may also be a terminal or a server, which is not limited herein. The embodiment of the present invention is described by taking a server as an execution subject.
In this embodiment, the first display content to be displayed is received through a function interface on a display component of a preset virtual caption, for example, "when actual hoisting is performed, the number of hoisting personnel needs to be determined according to the actual weight of equipment, and it is generally recommended to add one hoisting personnel every time 20KG is added" long sentence display:
"in actual hoisting, the actual weight of the equipment is determined
The number of hoisting personnel is generally recommended to be increased by 20KG every time
Adding one lifting worker "
The virtual caption display component is created according to the illusion engine, and is a component that can display captions, which is an object (Actor), and exists in the virtual world in reality.
The illusion engine writes code using C + +, has high portability, is a tool used by many game developers today, and focuses on data generation and program writing. Not only is a hall-level game engine, but also can bring unlimited creation freedom and unprecedented control for professionals in all walks of life. Whether it is a frontier content, interactive experience, or immersive virtual world, everything is in the illusion engine.
In this embodiment, the subtitles include a primary subtitle, a secondary subtitle, and a tertiary subtitle. The three-level subtitles also comprise a single-line three-level subtitle and a double-line three-level subtitle; both the first level subtitle and the second level subtitle contain only one scroll box (ScrollBox), and both the single line of the third level subtitle and the double line of the third level subtitle contain only one multilineue editable text box (multilineeeditabetbox). In design, the single-line three-level subtitles can only store one line of contents; the double-row three-level subtitles can store two rows of contents; the second-level subtitles are used for storing single-line third-level subtitles or double-line third-level subtitles; the primary captions are used to store the secondary captions.
102. Inputting the first display content into a first-level caption, creating a second-level caption based on the first-level caption, synchronizing the first display content to the second-level caption and adding the second-level caption to a scroll of the first-level caption;
in this embodiment, the first display content may refer to text content of all subtitles to be displayed received within a time period, or may refer to text content of all subtitles to be displayed received at a time point.
Creating a primary caption, and creating n secondary captions according to the current primary caption when receiving the text contents of n captions to be displayed in a time period; when receiving text contents of 1 subtitle to be displayed within a period of time, 1 secondary subtitle should be created according to the current primary subtitle. And further, according to the specific line number of the text content of the caption and the corresponding caption display rule, creating a corresponding three-level caption. Wherein the three-level subtitles include a single line of three-level subtitles and a double line of three-level subtitles. It should be noted that, when at least 2 secondary subtitles exist in the scroll of one primary subtitle, the subtitles are scrolled and played; when at least two single-line three-level subtitles exist in one two-level subtitle, the subtitles are played in a rolling mode. In other cases, the subtitles are displayed still and do not scroll.
In this embodiment, the primary subtitle takes charge of the overall control, and the primary subtitle is to be switched to a different secondary subtitle in a rolling manner whenever a new secondary subtitle is to be added to the primary subtitle.
103. Synchronizing the first display content to the second-level caption, cutting the first display content according to a preset caption display rule to generate at least one third-level caption, and adding the at least one third-level caption to a rolling block of the second-level caption, wherein the third-level caption comprises a single-line third-level caption and a double-line third-level caption;
in this embodiment, the first display content is synchronized from the primary subtitle to the secondary subtitle added to the scroll of the primary subtitle, and at least one tertiary subtitle is asserted according to a preset subtitle display rule. At this time, whether the first display content needs to be cut or not is mainly related to the specific text content and the subtitle display rule of the first display content. For example, if the first display content is "actually hoisting, the number of hoisting personnel needs to be determined according to the actual weight of the equipment", and if the caption display rule is "only one line can display no more than 15 words", the first display content needs to be cut; if the subtitle display rule is "one line can only display no more than 30 words", no cutting of the first display content is required.
Further, at least one tertiary subtitle is generated, and the (at least one) tertiary subtitle is added to the scroll box of the secondary subtitle. The second-level subtitles are responsible for local control, and each time different third-level subtitles (including single-line third-level subtitles and double-line third-level subtitles) are added into the (rolling blocks) of the second-level subtitles, the second-level subtitles are rolled and switched to different single-line third-level subtitles or double-line third-level subtitles.
Because the preset caption display rule, such as "the caption box can only accommodate 2 lines of characters at most", and the caption content to be input is flexible, there are two cases:
1. when the input first display content can be completely displayed within two lines, the subtitle (first display content) does not need to be scrolled at the moment;
2. if the input first display content exceeds two lines, three or four lines can be displayed completely; at this time, the analysis is specifically performed according to the specific situation.
104. And controlling at least one three-level caption to be displayed based on the first scrolling parameter of the scrolling block of the first-level caption and the second scrolling parameter of the second-level caption so as to realize the sequential playing of the first display content.
In this embodiment, according to the first scroll parameter of the scroll of the primary subtitle and the second scroll parameter of the scroll of the secondary subtitle, the (at least one) tertiary subtitle is controlled to be displayed, and the first display content is played. For example, the subtitle box can only accommodate two lines of display content at most, and when the input subtitles can be completely displayed within two lines, the double-line three-level subtitles are called (the double-line three-level subtitles can store the content within two lines); when the input caption (display content) exceeds two lines, the secondary caption can 'cut' the first display content input into the caption box into n lines of content, and then put the n contents into the corresponding n single lines of tertiary caption respectively; at this time, the scrolling parameter of the second-level caption calls for storing the single-line(s) of the third-level caption and scrolls and plays the display contents.
In the embodiment of the invention, a function interface on a preset virtual caption display component is used for receiving first display content to be displayed and inputting the first display content into a first-level caption; creating a secondary subtitle according to the primary subtitle, and synchronizing the first display content to the secondary subtitle; cutting the first display content through the secondary subtitles, and respectively inputting the cut display content into at least one tertiary subtitle created according to the secondary subtitles; and inputting the obtained three-level subtitles into the rolling block of the two-level subtitles, and controlling at least one three-level subtitle to display based on the first rolling parameter of the rolling block of the one-level subtitles and the second rolling parameter of the two-level subtitles so as to realize the sequential playing of the first display content. The subtitle function can be provided for the virtual application, and the subtitle exists in the virtual world in reality.
Referring to fig. 2, a second embodiment of the method for implementing a subtitle based on a ghost engine according to an embodiment of the present invention includes:
201. receiving first display content to be displayed through a function interface on a preset virtual caption display component, wherein the virtual caption display component is an object which is created based on a phantom engine and has a caption display function, and comprises a first-level caption, a second-level caption and a third-level caption;
202. inputting the first display content into a first-level caption, creating a second-level caption based on the first-level caption, synchronizing the first display content to the second-level caption and adding the second-level caption to a scroll of the first-level caption;
203. analyzing the first display content to obtain the total line number of the first display content, and judging whether the total line number is greater than a preset line number threshold value;
in this embodiment, the first display content is analyzed, and whether the first display content needs to be cut is determined according to an analysis result and a preset subtitle display rule.
The caption display rule is preset in the program, for example, the text content that the caption box can be displayed at most in 2 lines each time in the program, if the content to be displayed exceeds two lines, the content to be displayed needs to be cut, and then the next three-level caption creation and display can be performed; if the subtitle to be displayed does not exceed 2 lines, the content to be displayed does not need to be cut. Meanwhile, the number of the lines of the content to be displayed corresponds to different three-level subtitles.
204. Calculating the total number of bytes of the first display content;
in this embodiment, since the number of bytes corresponding to each character in the text is different from the number of bytes corresponding to each letter in the english, after the content to be displayed is analyzed and determined, the number of bytes of the content to be displayed needs to be calculated more exactly, and the content to be displayed is specifically cut according to the number of bytes of the content to be displayed.
Bytes (Byte) is a unit of measure used by computer information technology to measure storage capacity, and also represents data types and language characters in some computer programming languages. One bit section stores 8-bit unsigned numbers, with values in the range of 0-255. As with a word, a byte-wise variable needs to be stored in only one byte (8 bits) of memory space.
205. Judging whether the total byte number exceeds a first byte threshold value or not;
the caption display rule is preset in the program, for example, the text content that the caption box can be displayed at most in 2 lines each time in the program, if the content to be displayed exceeds two lines, the content to be displayed needs to be cut, and then the next three-level caption creation and display can be performed; if the subtitle to be displayed does not exceed 2 lines, the content to be displayed does not need to be cut. Meanwhile, the number of the lines of the content to be displayed corresponds to different three-level subtitles. However, specifically for the display content of each line, different programs correspond to different display rules, for example, the maximum displayable text content of the subtitle box in the program is 2 lines, but the maximum value of the number of bytes that can be accommodated by each line is preset, for example, 72 bytes, and the specific cutting processing needs to be performed on the display content according to the specific number of bytes of the display content, so that it is necessary to first determine whether the total number of bytes of the display content exceeds the first byte threshold value at this time.
206. If the total byte number does not exceed the first byte threshold value, creating a double-row three-level caption based on the two-level caption, and inputting the first display content into the double-row three-level caption through a preset function interface of the double-row three-level caption; adding the tertiary subtitles to the scroll of the secondary subtitles;
in this embodiment, if the total number of bytes of the content to be displayed does not exceed the maximum number of bytes preset by the program, the caption frame can accommodate the content to be displayed, and at this time, a double-row three-level caption can display the content to be displayed, and at this time, a double-row three-level caption is created directly according to the created two-level caption; and inputting the content to be displayed into the double-line three-level subtitles through a preset function interface of the double-line three-level subtitles, and adding the double-line three-level subtitles into a rolling block of the two-level subtitles.
207. If the total byte number exceeds a first byte threshold value, creating at least two single-line three-level subtitles based on the two-level subtitles, and respectively inputting the first display content into the at least two single-line three-level subtitles through a preset function interface of the single-line three-level subtitles; adding at least two single-line tertiary subtitles to a scroll of the secondary subtitles;
in this embodiment, if the total number of bytes of the content to be displayed exceeds the maximum number of bytes preset by the program, it is indicated that the subtitle box cannot accommodate the content to be displayed, at this time, a plurality of single-line three-level subtitles need to be created, the content to be displayed is cut, the cut content to be displayed is respectively input to the corresponding single-line three-level subtitles, the content to be displayed is input to the double-line three-level subtitles through a function interface preset by the single-line three-level subtitles, and the double-line three-level subtitles are added to the rolling blocks of the two-level subtitles.
The function interface is also called an interface function, which means that a certain module writes a function (mainly) for other modules. Simply speaking, an interface function is a common function in a class. For example: SendMessage (.): is a messaging function, we do not need to know how it is implemented, only need to know that he can implement sending a message to something. This is the interface, and the interface is the implementation correspondingly.
208. If the total line number is smaller than a preset line number threshold, creating a three-level subtitle with a subtitle display line number being the preset line number threshold, inputting the first display content into the three-level subtitle with the subtitle display line number being the preset line number threshold, and adding the three-level subtitle with the preset line number threshold into a rolling block of the two-level subtitle;
in this embodiment, if the total number of rows of the content to be displayed is less than the threshold of the preset number of rows, for example, when the content to be displayed is "actual hoisting," it is necessary to determine that the number of hoisting personnel "does not exceed 2 rows according to the actual weight of the device, at this time, only one double-row three-level subtitle needs to be created, and the text content (first display content) is received through the preset function interface, and the created three-level subtitle is added to the scroll block of the two-level subtitle.
The scroll box is a scrollable UI component to which content is added with a node display list (AddChild); the position to which to scroll is set with the set control offset (SetScrollOffset).
The secondary caption comprises a tertiary caption (double lines) or more than two tertiary captions (single lines); each level of caption contains a function interface (SetMyText) to receive the text content; the primary subtitle and the secondary subtitle each contain a scroll box (ScrollBox); the triple-level subtitles all contain a multi-line editable text box (multilinededataboxbox). And the three-level caption (single line or double lines) receives the text content (first display content) through a preset function interface, judges whether the text content exceeds two lines, cuts the text content if the text content exceeds two lines, plays the rolling animation, and adds the cut (displayed) text content into the rolling block again after the text content rolls to the bottom so as to continue rolling.
209. And controlling at least one three-level caption to be displayed based on the first scrolling parameter of the scrolling block of the first-level caption and the second scrolling parameter of the second-level caption so as to realize the sequential playing of the first display content.
The steps 201, 202, 209 in this embodiment are similar to the steps 101, 102, 104 in the first embodiment, and are not described here again.
In the embodiment of the invention, a function interface on a preset virtual caption display component is used for receiving first display content to be displayed and inputting the first display content into a first-level caption; creating a secondary subtitle according to the primary subtitle, and synchronizing the first display content to the secondary subtitle; cutting the first display content through the secondary subtitles, and respectively inputting the cut display content into at least one tertiary subtitle created according to the secondary subtitles; and inputting the obtained three-level subtitles into the rolling block of the two-level subtitles, and controlling at least one three-level subtitle to display based on the first rolling parameter of the rolling block of the one-level subtitles and the second rolling parameter of the two-level subtitles so as to realize the sequential playing of the first display content. The subtitle function can be provided for the virtual application, and the subtitle exists in the virtual world in reality.
Referring to fig. 3, a third embodiment of the method for implementing subtitles based on a ghost engine according to the embodiment of the present invention includes:
301. receiving first display content to be displayed through a function interface on a preset virtual caption display component, wherein the virtual caption display component is an object which is created based on a phantom engine and has a caption display function, and comprises a first-level caption, a second-level caption and a third-level caption;
302. inputting the first display content into a first-level caption, creating a second-level caption based on the first-level caption, and adding the second-level caption into a rolling block of the first-level caption;
303. creating an array based on the secondary caption, and storing the first display content into the array to obtain a second display content;
in this embodiment, an array is created for storing the display content based on the secondary subtitle, and the first display content is renamed. For example, when the first display content is "actually hoisting, the hoisting number needs to be determined according to the actual weight of the equipment," generally, 20KG is added for each increase of the first display content "is input into the created array, at this time, the first display content is named as" second display content, "then, the second display content is" when the actual hoisting is performed, the hoisting number needs to be determined according to the actual weight of the equipment, generally, 20KG is added for each increase of the second display content, "at this time, whether the input second display content exceeds 36 bytes is judged. And further, carrying out the next operation according to the judgment result.
The Array (Array) is an ordered sequence of elements. If a set of a finite number of variables of the same type is named, then this name is the array name. The individual variables that make up an array are referred to as the components of the array, also referred to as the elements of the array, and sometimes as subscript variables. The numerical numbering used to distinguish the various elements of the array is referred to as the subscript. An array is a form in which elements of the same type are organized in an ordered fashion for processing convenience in programming. The collection of these ordered homogeneous data elements is called an array. An array is a collection for storing multiple data of the same type. An array may be decomposed into a plurality of array elements, which may be of either primitive data type or construct type. Therefore, the array can be divided into various categories such as numerical array, character array, pointer array, and structure array according to the type of the array elements.
304. Judging whether the second display content exceeds a second byte threshold value;
and judging whether the display content input into the array exceeds the preset maximum value of the byte number. For example, when the second display content in the input array is "actual hoisting, the hoisting number needs to be determined according to the actual weight of the equipment, and generally, it is recommended to add one hoisting person every 20KG, and at this time, it is assumed that the preset byte number threshold is 36 bytes, and it is determined whether the input second display content exceeds 36 bytes. And obtaining a Bernoulli result, correspondingly cutting the second display content according to the judgment result, and inputting the cut display content into corresponding three-level subtitles through preset function interfaces respectively.
305. If the second display content does not exceed the second byte threshold, acquiring the second display content in the array, and creating a single-line three-level caption for the second display content;
if the second display content in the array does not exceed the preset maximum value of the byte number, for example, the byte number of the display content in the array does not exceed 36 bytes, a single-line three-level caption is created for the second display content in the array. Since a single line of three-level subtitles can store a maximum of 36 bytes of display content.
306. Inputting the second display content into the single-line three-level caption through a preset function interface of the single-line three-level caption and adding the single-line three-level caption into a rolling block of the second-level caption;
and receiving the text in the display content through a preset function interface of the created single-line three-basis function, adding the text in the display content to the single-line three-level caption, simultaneously adding the single-line three-level caption to a rolling block of the local two-level caption, and finishing cutting.
307. If the second display content exceeds the second byte threshold, acquiring the first N bytes of the second display content through a preset GetSubstending function interface, and cutting the first N bytes from the second display content through a preset Split function interface to obtain a third display content and a fourth display content, wherein N is equal to the second byte threshold, and the fourth display content is a byte except the third display content in the second display content;
in this embodiment, the display content in the input array exceeds the preset of the preset inputtable bytes, then the first N bytes of the display content are obtained through the preset getsharing function interface, for example, the second display content is "when in actual hoisting, the hoisting number needs to be determined according to the actual weight of the equipment, generally, it is recommended to add one hoisting person for every 20KG increase", the first N bytes of the second actual content "when in actual hoisting, needs to be determined according to the actual weight of the equipment", and the content of the first N bytes of the second display content is named as the third display content, that is, the third display content needs to be determined according to the actual weight of the equipment when in actual hoisting ".
When the third display content is actually hoisted, the input array needs to be determined according to the actual weight of the equipment, the third display content is cut from the second display content through the Split function interface, and the remaining content in the second display content is named as fourth display content, for example, when the third display content is actually hoisted, the hoisting number "from the second display content" needs to be determined according to the actual weight of the equipment, generally, the hoisting number is increased by one hoisting person every 20KG, and the hoisting number of the remaining bytes is generally recommended, and the hoisting number is named as fourth display content every 20 KG.
308. Continuing to cut the fourth display content to obtain fifth display content with the length of M bytes not greater than the threshold of the second bytes;
determining the hoisting number according to the actual weight of the equipment when the actual hoisting is carried out on the second display content, and determining an input array according to the actual weight of the equipment when the actual hoisting is carried out on the third display content cut out from the general suggestion that 20KG is added every time, so as to obtain the hoisting number of the fourth display content, and generally suggesting that 20KG is added every time; at this time, the number of bytes of the fourth display content, i.e., the number of hoisted bytes, is continuously judged, it is generally recommended that one hoister is added every 20KG increase, whether the number exceeds 36 bytes is judged, and if the number exceeds 36 bytes, the fourth display content is continuously cut until the number of breeding bytes in the display content does not exceed the preset maximum value of bytes, such as 36 bytes. And obtaining n display contents, wherein n is a positive integer greater than or equal to 2.
309. Creating M +1 single-line three-level subtitles based on the fifth display content, respectively inputting the M +1 display contents into the corresponding single-line three-level subtitles through a preset function interface of the single-line three-level subtitles, and adding the M +1 single-line three-level subtitles into a rolling block of the second-level subtitles;
respectively creating a single-line three-level caption for each display content according to the n display contents cut by the second display content; because a single line of three-level subtitles can just store one display content (byte number less than or equal to 36 bytes). At this time, one display content is corresponded to one single line of three-level subtitles.
And respectively adding the n display contents into the rolling blocks of the secondary subtitles through the preset function interfaces of the three-level subtitles of a single line, wherein the n display contents obtained by cutting are not more than the preset maximum threshold value in number of bytes. For example, the second display content "in actual hoisting, the hoisting number needs to be determined according to the actual weight of the equipment," generally, 20KG is added every time a hoisting person is added, "in actual hoisting, the hoisting number needs to be determined according to the actual weight of the equipment," in third display content, "in actual hoisting, the hoisting number needs to be determined according to the actual weight of the equipment," in fourth display content, "20 KG is added every time a hoisting person is added," and "in fifth display content" a hoisting person is added "; at the moment, n is 3, corresponding to the three-level subtitles of 3 single lines, and inputting the third display content, the fourth display content and the fifth display content into the corresponding three-level subtitles of each single line through a preset function interface corresponding to the three-level subtitles of each single line; and adding the three-level subtitles carrying a single line of the display content to the scroll box of the local two-level subtitles.
310. And controlling at least one three-level caption to be displayed based on the first rolling parameter of the rolling block of the first-level caption and the second rolling parameter of the rolling block of the second-level caption so as to realize the sequential playing of the first display content.
The steps 301-302 and 310 in the present embodiment are similar to the steps 101-102 and 104 in the first embodiment, and are not described herein again.
In the embodiment of the invention, a function interface on a preset virtual caption display component is used for receiving first display content to be displayed and inputting the first display content into a first-level caption; creating a secondary subtitle according to the primary subtitle, and synchronizing the first display content to the secondary subtitle; cutting the first display content through the secondary subtitles, and respectively inputting the cut display content into at least one tertiary subtitle created according to the secondary subtitles; and inputting the obtained three-level subtitles into the rolling block of the two-level subtitles, and controlling at least one three-level subtitle to display based on the first rolling parameter of the rolling block of the one-level subtitles and the second rolling parameter of the two-level subtitles so as to realize the sequential playing of the first display content. The subtitle function can be provided for the virtual application, and the subtitle exists in the virtual world in reality.
Referring to fig. 4, a fourth embodiment of the method for implementing subtitles based on a ghost engine according to the embodiment of the present invention includes:
401. receiving first display content to be displayed through a function interface on a preset virtual caption display component, wherein the virtual caption display component is an object which is created based on a phantom engine and has a caption display function, and comprises a first-level caption, a second-level caption and a third-level caption;
402. inputting the first display content into a first-level caption, creating a second-level caption based on the first-level caption, and adding the second-level caption into a rolling block of the first-level caption;
403. synchronizing the first display content to the second-level caption, cutting the first display content according to a preset caption display rule to generate at least one third-level caption, and adding the at least one third-level caption to a rolling block of the second-level caption, wherein the third-level caption comprises a single-line third-level caption and a double-line third-level caption;
404. selecting one of the at least two secondary subtitles to display, and setting other secondary subtitles to be in a state to be displayed;
because each primary caption at least comprises two secondary captions, and the rolling playing of the captions is rolled according to the rolling parameters; therefore, one of the at least two secondary subtitles is selected for display, and the other secondary subtitles are set to be in a state to be realized.
The primary caption comprises one or more secondary captions; the secondary subtitles include one tertiary subtitle (double line) or more than two tertiary subtitles (single line). Each level of caption contains a function interface (SetMyText) to accept the text content. The primary subtitle and the secondary subtitle respectively comprise a ScrollBox; the triple-level subtitles all contain a multilinededatabettextbox (multi-line editable text box).
405. When the display of the three-level caption in the currently displayed two-level caption is controlled to be completed through the second rolling parameter, the two-level caption is controlled to roll through the first rolling parameter;
when the second rolling parameter corresponding to the second-level caption controls the display of a plurality of third-level captions in the current second-level caption to be finished, the rolling of the second-level caption is further controlled through the first rolling parameter in the first-level caption. The switching between subtitles is also by means of scrolling. That is, when subtitle a is to be switched to subtitle B, the subtitle a content is cleared and the subtitle B content scrolls.
406. And based on the first scrolling parameter, selecting a corresponding next to-be-scrolled secondary caption from the secondary captions in the to-be-displayed state, and sequentially playing the first display content.
And according to the first scrolling parameter, selecting a corresponding next to-be-scrolled secondary subtitle from the to-be-displayed secondary subtitles, for example, after the current secondary subtitle a is scrolled, selecting a corresponding secondary subtitle B from the to-be-displayed secondary subtitle B, C, D, E to scroll, and sequentially playing the first display content.
Steps 401-403 in this embodiment are similar to steps 101-103 in the first embodiment, and are not described herein again.
In the embodiment of the invention, a function interface on a preset virtual caption display component is used for receiving first display content to be displayed and inputting the first display content into a first-level caption; creating a secondary subtitle according to the primary subtitle, and synchronizing the first display content to the secondary subtitle; cutting the first display content through the secondary subtitles, and respectively inputting the cut display content into at least one tertiary subtitle created according to the secondary subtitles; and inputting the obtained three-level subtitles into the rolling block of the two-level subtitles, and controlling at least one three-level subtitle to display based on the first rolling parameter of the rolling block of the one-level subtitles and the second rolling parameter of the two-level subtitles so as to realize the sequential playing of the first display content. The subtitle function can be provided for the virtual application, and the subtitle exists in the virtual world in reality.
Referring to fig. 5, a fifth embodiment of the method for implementing subtitles based on a ghost engine according to the embodiment of the present invention includes:
501. receiving first display content to be displayed through a function interface on a preset virtual caption display component, wherein the virtual caption display component is an object which is created based on a phantom engine and has a caption display function, and comprises a first-level caption, a second-level caption and a third-level caption;
502. inputting the first display content into a first-level caption, creating a second-level caption based on the first-level caption, and adding the second-level caption into a rolling block of the first-level caption;
503. synchronizing the first display content to the second-level caption, cutting the first display content according to a preset caption display rule to generate at least one third-level caption, and adding the at least one third-level caption to a rolling block of the second-level caption, wherein the third-level caption comprises a single-line third-level caption and a double-line third-level caption;
504. controlling at least one three-level caption to be displayed based on a first rolling parameter of a rolling block of the first-level caption and a second rolling parameter of a rolling block of the second-level caption so as to realize the sequential playing of the first display content;
505. receiving text content to be displayed, and naming the text content as first display content;
when the last display content is displayed, the first-level caption receives new content to be displayed through a preset function interface and names the newly received text content as the first display content. For example, when the previous first display content is "actual hoisting, the hoisting number needs to be determined according to the actual weight of the equipment, generally, it is recommended to add one hoisting worker every 20KG, the hoisting worker is divided into four" sub-display contents ", the scrolling display is completed according to the scrolling parameters of each level of subtitles, at this time, the new text content is" the working time of each hoisting worker is 3 hours, more than 3 hours, a new batch of hoisting workers can perform subsequent hoisting work ", the new text content is renamed as the first display content, and further, the new text content is processed according to the specific content of the display content and is played in a scrolling manner.
506. And manufacturing a subtitle body based on the first display content and setting the subtitle based on the user requirement.
And making a caption body required by a user according to the real content, and sequentially playing in a rolling manner.
The steps 501-504 in this embodiment are similar to the steps 101-104 in the first embodiment, and are not described herein again.
In the embodiment of the invention, a function interface on a preset virtual caption display component is used for receiving first display content to be displayed and inputting the first display content into a first-level caption; creating a secondary subtitle according to the primary subtitle, and synchronizing the first display content to the secondary subtitle; cutting the first display content through the secondary subtitles, and respectively inputting the cut display content into at least one tertiary subtitle created according to the secondary subtitles; and inputting the obtained three-level subtitles into the rolling block of the two-level subtitles, and controlling at least one three-level subtitle to display based on the first rolling parameter of the rolling block of the one-level subtitles and the second rolling parameter of the two-level subtitles so as to realize the sequential playing of the first display content. The subtitle function can be provided for the virtual application, and the subtitle exists in the virtual world in reality.
With reference to fig. 6, the method for implementing a subtitle based on an illusion engine in the embodiment of the present invention is described above, and a subtitle implementing apparatus based on an illusion engine in the embodiment of the present invention is described below, where a first embodiment of the subtitle implementing apparatus based on an illusion engine in the embodiment of the present invention includes:
a receiving module 601, configured to receive a first display content to be displayed through a function interface on a preset virtual caption display component, where the virtual caption display component is an object created based on a phantom engine and having a caption display function, and includes a first-level caption, a second-level caption, and a third-level caption;
a creating module 602, configured to input the first display content into the primary subtitle, create a secondary subtitle based on the primary subtitle, synchronize the first display content to the secondary subtitle, and add the secondary subtitle to a scroll of the primary subtitle;
the cutting module 603 is configured to synchronize the first display content to the second-level subtitles, cut the first display content according to preset subtitle display rules, generate at least one third-level subtitle, and add the at least one third-level subtitle to a rolling block of the second-level subtitles, where the third-level subtitle includes a single-line third-level subtitle and a double-line third-level subtitle;
the playing module 604 is configured to control the at least one third-level subtitle to be displayed based on a first scroll parameter of the scroll of the first-level subtitle and a second scroll parameter of the scroll of the second-level subtitle, so as to sequentially play the first display content.
In the embodiment of the invention, a function interface on a preset virtual caption display component is used for receiving first display content to be displayed and inputting the first display content into a first-level caption; creating a secondary subtitle according to the primary subtitle, and synchronizing the first display content to the secondary subtitle; cutting the first display content through the secondary subtitles, and respectively inputting the cut display content into at least one tertiary subtitle created according to the secondary subtitles; and inputting the obtained three-level subtitles into the rolling block of the two-level subtitles, and controlling at least one three-level subtitle to display based on the first rolling parameter of the rolling block of the one-level subtitles and the second rolling parameter of the two-level subtitles so as to realize the sequential playing of the first display content. The subtitle function can be provided for the virtual application, and the subtitle exists in the virtual world in reality.
Referring to fig. 7, a second embodiment of the subtitle implementing apparatus based on the illusion engine according to the embodiment of the present invention specifically includes:
a receiving module 601, configured to receive a first display content to be displayed through a function interface on a preset virtual caption display component, where the virtual caption display component is an object created based on a phantom engine and having a caption display function, and includes a first-level caption, a second-level caption, and a third-level caption;
a creating module 602, configured to input the first display content into the primary subtitle, create a secondary subtitle based on the primary subtitle, synchronize the first display content to the secondary subtitle, and add the secondary subtitle to a scroll of the primary subtitle;
the cutting module 603 is configured to synchronize the first display content to the second-level subtitles, cut the first display content according to preset subtitle display rules, generate at least one third-level subtitle, and add the at least one third-level subtitle to a rolling block of the second-level subtitles, where the third-level subtitle includes a single-line third-level subtitle and a double-line third-level subtitle;
a playing module 604, configured to control the at least one third-level subtitle to be displayed based on a first scrolling parameter of the scrolling block of the first-level subtitle and a second scrolling parameter of the scrolling block of the second-level subtitle, so as to sequentially play the first display content;
in this embodiment, the cutting module 603 includes:
an analyzing unit 6031, configured to analyze the first display content to obtain a total number of lines of the first display content;
a determining unit 6032, configured to determine whether the total number of lines is greater than a preset number-of-lines threshold;
a cutting unit 6033, configured to, when the total line number is greater than a preset line number threshold, invoke a caption cutting algorithm, cut the first display content to obtain at least two display captions, create at least two three-level captions based on the at least two display captions, and add the at least two three-level captions to a rolling block of the two-level caption;
a creating unit 6034, configured to, when the total line number is smaller than a preset line number threshold, create a three-level subtitle with a subtitle display line number that is the preset line number threshold, input the first display content into the three-level subtitle with the subtitle display line number that is the preset line number threshold, and add the three-level subtitle with the preset line number threshold into a scroll box of the two-level subtitle.
In this embodiment, the cutting module cutting unit 6033 is specifically configured to:
calculating the total number of bytes of the first display content;
judging whether the total byte number exceeds a first byte threshold value or not;
if not, creating a double-line three-level caption based on the second-level caption, and inputting the first display content into the double-line three-level caption through a preset function interface of the double-line three-level caption; adding the tertiary subtitles to a scroll of the secondary subtitles;
if so, creating at least two single-line three-level subtitles based on the two-level subtitles, and respectively inputting the first display content into the at least two single-line three-level subtitles through a preset function interface of the single-line three-level subtitles; adding the at least two single line tertiary subtitles to a scroll box of the secondary subtitles.
In this embodiment, the creating unit 6034 is specifically configured to:
creating an array based on the secondary caption, and storing the first display content to the array to obtain a second display content;
judging whether the second display content exceeds a second byte threshold value;
if the second display content does not exceed the second byte threshold, acquiring the second display content in the array, and creating a single-line three-level caption for the second display content;
and inputting the second display content into the single-line three-level subtitles and adding the single-line three-level subtitles into a rolling block of the two-level subtitles through a preset function interface of the single-line three-level subtitles.
In this embodiment, the creating unit 6034 is further specifically configured to:
if the second display content exceeds the second byte threshold, obtaining the first N bytes of the second display content through a preset GetSubstring function interface, and cutting the first N bytes from the second display content through a preset Split function interface to obtain a third display content and a fourth display content, wherein N is equal to the second byte threshold, and the fourth display content is a byte except the third display content in the second display content;
continuing to cut the fourth display content to obtain fifth display content with the length of M bytes not greater than the second byte threshold;
and creating M +1 single-line three-level subtitles based on the fifth display content, respectively inputting the M +1 display contents into the corresponding single-line three-level subtitles through a preset function interface of the single-line three-level subtitles, and adding the M +1 single-line three-level subtitles into a rolling block of the two-level subtitles.
In this embodiment, the apparatus further includes:
a naming module 605, configured to receive a text content to be displayed, and name the text content as a first display content;
a setting module 606, configured to make a subtitle body based on the first display content and set the subtitle based on a user requirement.
In the embodiment of the invention, a function interface on a preset virtual caption display component is used for receiving first display content to be displayed and inputting the first display content into a first-level caption; creating a secondary subtitle according to the primary subtitle, and synchronizing the first display content to the secondary subtitle; cutting the first display content through the secondary subtitles, and respectively inputting the cut display content into at least one tertiary subtitle created according to the secondary subtitles; and inputting the obtained three-level subtitles into the rolling block of the two-level subtitles, and controlling at least one three-level subtitle to display based on the first rolling parameter of the rolling block of the one-level subtitles and the second rolling parameter of the two-level subtitles so as to realize the sequential playing of the first display content. The subtitle function can be provided for the virtual application, and the subtitle exists in the virtual world in reality.
Fig. 6 and 7 describe the apparatus for implementing a subtitle based on a ghost engine in detail in the embodiment of the present invention from the perspective of a modular functional entity, and the apparatus for implementing a subtitle based on a ghost engine in the embodiment of the present invention from the perspective of hardware processing in the following.
Fig. 8 is a schematic structural diagram of a ghost engine-based subtitle implementing apparatus 800 according to an embodiment of the present invention, which may include one or more processors (CPUs) 810 (e.g., one or more processors) and a memory 820, and one or more storage media 830 (e.g., one or more mass storage devices) storing applications 833 or data 832, where the ghost engine-based subtitle implementing apparatus 800 may have relatively large differences due to different configurations or performances. Memory 820 and storage medium 830 may be, among other things, transient or persistent storage. The program stored in the storage medium 830 may include one or more modules (not shown), each of which may include a series of instruction operations for the illusion engine-based subtitle implementing apparatus 800. Further, the processor 810 may be configured to communicate with the storage medium 830, and execute a series of instruction operations in the storage medium 830 on the illusion engine-based subtitle implementing device 800 to implement the steps of the illusion engine-based subtitle implementing method provided by the above-described method embodiments.
The ghost engine based subtitle implementation 800 may also include one or more power supplies 840, one or more wired or wireless network interfaces 850, one or more input-output interfaces 860, and/or one or more operating systems 831, such as Windows server, Mac OS X, Unix, Linux, FreeBSD, and so on. Those skilled in the art will appreciate that the architecture of the illusion engine-based subtitle implementation shown in fig. 8 does not constitute a limitation of the illusion engine-based subtitle implementation provided herein, and may include more or fewer components than shown, or combine certain components, or a different arrangement of components.
The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, and may also be a volatile computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the instructions cause the computer to execute the steps of the above-mentioned ghost engine-based subtitle implementing method.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A subtitle realization method based on a virtual engine is characterized by comprising the following steps:
receiving first display content to be displayed through a function interface on a preset virtual caption display component, wherein the virtual caption display component is an object which is created based on a phantom engine and has a caption display function, and comprises a first-level caption, a second-level caption and a third-level caption;
inputting the first display content into the primary caption, creating a secondary caption based on the primary caption, synchronizing the first display content to the secondary caption and adding the secondary caption to a scroll of the primary caption;
cutting the first display content according to preset subtitle display rules to generate at least one three-level subtitle, and adding the at least one three-level subtitle into a rolling block of the two-level subtitle, wherein the three-level subtitle comprises a single-line three-level subtitle and a double-line three-level subtitle;
and controlling the at least one third-level caption to be displayed based on the first rolling parameter of the rolling block of the first-level caption and the second rolling parameter of the rolling block of the second-level caption so as to realize the sequential playing of the first display content.
2. The method for implementing a subtitle based on a ghost engine according to claim 1, wherein the cutting the first display content according to preset subtitle display rules to generate at least one tertiary subtitle, and the adding the at least one tertiary subtitle to the scroll box of the secondary subtitle includes:
analyzing the first display content to obtain the total line number of the first display content;
judging whether the total line number is larger than a preset line number threshold value or not;
if so, calling a caption cutting algorithm, cutting the first display content to obtain at least two display captions, creating at least two three-level captions based on the at least two display captions, and adding the at least two three-level captions into a rolling block of the two-level caption;
if not, creating a three-level caption with the caption display line number being the preset line number threshold, inputting the first display content into the three-level caption with the caption display line number being the preset line number threshold, and adding the three-level caption with the preset line number threshold into a rolling block of the two-level caption.
3. The method for implementing a subtitle based on a ghost engine according to claim 2, wherein the invoking a subtitle cutting algorithm to cut the first display content to generate at least two tertiary subtitles, and the adding the at least two tertiary subtitles to the scroll box of the secondary subtitles comprises:
calculating the total number of bytes of the first display content;
judging whether the total byte number exceeds a first byte threshold value or not;
if not, creating a double-line three-level caption based on the second-level caption, and inputting the first display content into the double-line three-level caption through a preset function interface of the double-line three-level caption; adding the tertiary subtitles to a scroll of the secondary subtitles;
if so, creating at least two single-line three-level subtitles based on the two-level subtitles, and respectively inputting the first display content into the at least two single-line three-level subtitles through a preset function interface of the single-line three-level subtitles; adding the at least two single line tertiary subtitles to a scroll box of the secondary subtitles.
4. The illusion engine-based subtitle implementation method of claim 3, wherein the creating of the at least two single-line three-level subtitles based on the two-level subtitles and the inputting of the first display content into the at least two single-line three-level subtitles respectively through a preset function interface of the single-line three-level subtitles; adding the at least two single line tertiary subtitles to the scroll box of the secondary subtitles comprises:
creating an array based on the secondary caption, and storing the first display content to the array to obtain a second display content;
judging whether the second display content exceeds a second byte threshold value;
if the second display content does not exceed the second byte threshold, acquiring the second display content in the array, and creating a single-line three-level caption for the second display content;
and inputting the second display content into the single-line three-level subtitles and adding the single-line three-level subtitles into a rolling block of the two-level subtitles through a preset function interface of the single-line three-level subtitles.
5. The illusion engine-based subtitle implementation method of claim 4, wherein the creating of the at least two single-line three-level subtitles based on the two-level subtitles and the inputting of the first display content into the at least two single-line three-level subtitles respectively through a preset function interface of the single-line three-level subtitles; adding the at least two single line tertiary subtitles to a scroll box of the secondary subtitles, further comprising:
if the second display content exceeds the second byte threshold, obtaining the first N bytes of the second display content through a preset GetSubstring function interface, and cutting the first N bytes from the second display content through a preset Split function interface to obtain a third display content and a fourth display content, wherein N is equal to the second byte threshold, and the fourth display content is a byte except the third display content in the second display content;
continuing to cut the fourth display content to obtain fifth display content with the length of M bytes not greater than the second byte threshold;
and creating M +1 single-line three-level subtitles based on the fifth display content, respectively inputting preset M +1 display contents into the corresponding single-line three-level subtitles through a preset function interface of the single-line three-level subtitles, and adding the M +1 single-line three-level subtitles into a rolling block of the second-level subtitles.
6. The illusion engine-based subtitle implementation method of any one of claims 1-5, wherein the controlling the at least one tertiary subtitle to be displayed based on a first scroll parameter of the primary subtitle and a second scroll parameter of the secondary subtitle to implement sequential playing of the first display content includes:
selecting one of the at least two secondary subtitles to display, and setting other secondary subtitles to be in a state to be displayed;
when the display of the three-level caption in the currently displayed two-level caption is controlled to be completed through the second rolling parameter, controlling the two-level caption to roll through the first rolling parameter;
and selecting the corresponding next to-be-scrolled secondary caption from the secondary captions in the to-be-displayed state based on the first scrolling parameter, and sequentially playing the first display content.
7. The illusion engine-based subtitle implementation method of any one of claims 1-4, wherein after controlling the at least one tertiary subtitle to be displayed based on the first scroll parameter of the primary subtitle and the second scroll parameter of the secondary subtitle to implement sequential playing of the first display content, further comprising:
receiving text content to be displayed, and naming the text content as first display content;
and manufacturing a subtitle body based on the first display content and setting the subtitle based on the user requirement.
8. A subtitle realizing device based on a virtual engine is characterized by comprising:
the receiving module is used for receiving first display content to be displayed through a function interface on a preset virtual caption display component, wherein the virtual caption display component is an object which is created based on a virtual engine and has a caption display function, and comprises a first-level caption, a second-level caption and a third-level caption;
the creating module is used for inputting the first display content into the primary caption, creating a secondary caption based on the primary caption, synchronizing the first display content to the secondary caption and adding the secondary caption to a scroll block of the primary caption;
the cutting module is used for synchronizing the first display content to the second-level subtitles, cutting the first display content according to preset subtitle display rules to generate at least one third-level subtitle and adding the at least one third-level subtitle to a rolling block of the second-level subtitles, wherein the third-level subtitle comprises a single-line third-level subtitle and a double-line third-level subtitle;
and the playing module is used for controlling the at least one third-level caption to be displayed based on the first rolling parameter of the rolling block of the first-level caption and the second rolling parameter of the rolling block of the second-level caption so as to realize the sequential playing of the first display content.
9. A subtitle implementing device based on a ghost engine, comprising: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line;
the at least one processor invokes the instructions in the memory to cause the illusion engine-based subtitle implementing device to perform the illusion engine-based subtitle implementing method of any of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the ghost engine based subtitle implementation method according to any one of claims 1-7.
CN202010692818.XA 2020-07-17 2020-07-17 Method, device and equipment for realizing subtitles based on illusion engine and storage medium Active CN111885365B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010692818.XA CN111885365B (en) 2020-07-17 2020-07-17 Method, device and equipment for realizing subtitles based on illusion engine and storage medium
CN202210078696.4A CN114500974B (en) 2020-07-17 2020-07-17 Caption realization method, equipment and storage medium based on illusion engine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010692818.XA CN111885365B (en) 2020-07-17 2020-07-17 Method, device and equipment for realizing subtitles based on illusion engine and storage medium

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202210078696.4A Division CN114500974B (en) 2020-07-17 2020-07-17 Caption realization method, equipment and storage medium based on illusion engine

Publications (2)

Publication Number Publication Date
CN111885365A CN111885365A (en) 2020-11-03
CN111885365B true CN111885365B (en) 2022-02-11

Family

ID=73156070

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202010692818.XA Active CN111885365B (en) 2020-07-17 2020-07-17 Method, device and equipment for realizing subtitles based on illusion engine and storage medium
CN202210078696.4A Active CN114500974B (en) 2020-07-17 2020-07-17 Caption realization method, equipment and storage medium based on illusion engine

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202210078696.4A Active CN114500974B (en) 2020-07-17 2020-07-17 Caption realization method, equipment and storage medium based on illusion engine

Country Status (1)

Country Link
CN (2) CN111885365B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111885365B (en) * 2020-07-17 2022-02-11 深圳市瑞立视多媒体科技有限公司 Method, device and equipment for realizing subtitles based on illusion engine and storage medium

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070011012A1 (en) * 2005-07-11 2007-01-11 Steve Yurick Method, system, and apparatus for facilitating captioning of multi-media content
CN102067591B (en) * 2008-06-26 2014-03-19 松下电器产业株式会社 Reproducing device, recording device, reproducing method and recording method
CN102158666A (en) * 2010-04-21 2011-08-17 青岛海信传媒网络技术有限公司 Method and device for displaying rolling subtitles
CN102694990B (en) * 2011-08-29 2015-02-18 新奥特(北京)视频技术有限公司 Method and device for realizing variable-length rolling screen
KR101663098B1 (en) * 2014-03-26 2016-10-25 주식회사 해리슨 앤 컴퍼니 Content reproduction system and method for language-learning
CN105320684B (en) * 2014-07-28 2019-03-01 中国传媒大学 The method for interchanging data of closed caption
WO2018207045A1 (en) * 2017-05-10 2018-11-15 Within Unlimited, Inc. Placement and dynamic rendering of caption information in virtual reality video
CN109696953B (en) * 2017-10-19 2020-10-16 华为技术有限公司 Virtual reality character display method and device and virtual reality equipment
CN107911734B (en) * 2017-11-10 2020-04-03 青岛海信电器股份有限公司 Subtitle display method, device and computer storage medium
CN110575667B (en) * 2019-08-28 2023-05-26 深圳市瑞立视多媒体科技有限公司 Control method, device, equipment and storage medium based on UI (user interface)
CN111885365B (en) * 2020-07-17 2022-02-11 深圳市瑞立视多媒体科技有限公司 Method, device and equipment for realizing subtitles based on illusion engine and storage medium

Also Published As

Publication number Publication date
CN111885365A (en) 2020-11-03
CN114500974A (en) 2022-05-13
CN114500974B (en) 2024-01-30

Similar Documents

Publication Publication Date Title
CN100414496C (en) Method and tool for generating and displaying a descriptive annotation of selected application data
US8024297B2 (en) Data logging system and method thereof for heterogeneous data
CN110794968B (en) Emergency drilling interaction system and method based on scene construction
CA2377353A1 (en) Navigating data points in a multidimensional database
US20100122171A1 (en) Non-linear slide presentation management for slide show programs
EP0268069B1 (en) Method of forming a message file in a computer
CN111885365B (en) Method, device and equipment for realizing subtitles based on illusion engine and storage medium
CN111538731B (en) Automatic report generation system for industrial data
CN101802765B (en) Method, and apparatus for facilitating object selection on display screen
JP2006293788A (en) Information processing unit and program
KR101473530B1 (en) Program creation supporting device and program creation supporting method
JPH03191475A (en) Document summarizing system
JPH0421224B2 (en)
JP6532094B1 (en) Display processing apparatus, display processing method, and program
RU98274U1 (en) METHOD AND SYSTEM OF SECURITY OF PRODUCTION USING INTELLECTUAL GRAPHICS
JP2009265710A (en) Operation division method and system therefor
JP2885297B2 (en) Character string input control method for character input device
US6055648A (en) Method and apparatus for recovering the computing error, and a computer-readable recording medium for storing the program for executing the method
JPH0535432A (en) Menu output processing system
JPS61246839A (en) Program diagram generating device
JPH0326422B2 (en)
CN117033606A (en) Dialogue management method, system, equipment and medium for dialogue robot
JP2790700B2 (en) Visual simulation device
JPS6395571A (en) Electronic dictionary
JPH04184570A (en) Block diagram drawing 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
GR01 Patent grant
GR01 Patent grant